This is a migrated thread and some comments may be shown as answers.

Uncaught ReferenceError: ViewDetails is not defined

3 Answers 247 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jitendra
Top achievements
Rank 1
Jitendra asked on 22 Oct 2013, 11:09 AM
Hello,

this is my first post . I got this error  Uncaught ReferenceError: ViewDetails is not defined
in google chrome . when i click on details button on my telerik grid. it work fine on IE 8. is anything wrong on script.

<script type="text/javascript">//language="javascript" 

            function ClientTabSelectedHandler(sender, eventArgs) {
                var tabStrip = sender;
                var tab = tabStrip.get_selectedTab();
                if (tab != null) {
                    var TabValue = tab.get_value();
                    var IsRebindVendorGrid = document.getElementById("ctl00_MainContentPlaceHolder_HiddenField_IsPWVBind").value;
                    var IsRebindPWGrid = document.getElementById("ctl00_MainContentPlaceHolder_HiddenField_IsPWBind").value;
                    if (TabValue == "PartItemByVendors") {
                        document.getElementById("ctl00_MainContentPlaceHolder_Button_Save").style.display = "none";
                        document.getElementById("ctl00_MainContentPlaceHolder_Button_CopyRecord").style.display = "none";
                        if (IsRebindVendorGrid != "1") {
                            refreshPartItemByVendors();
                        }
                    }
                    else if (TabValue == "PartItemByWarehouses") {
                        document.getElementById("ctl00_MainContentPlaceHolder_Button_Save").style.display = "none";
                        document.getElementById("ctl00_MainContentPlaceHolder_Button_CopyRecord").style.display = "none";
                        if (IsRebindPWGrid != "1") {
                            refreshPartByWarehouses();
                        }
                    }
                    else if (TabValue == "DrawingRevision") {
                        document.getElementById("ctl00_MainContentPlaceHolder_Button_Save").style.display = "none";
                        document.getElementById("ctl00_MainContentPlaceHolder_Button_CopyRecord").style.display = "none";
                    }
                    else {
                        document.getElementById("ctl00_MainContentPlaceHolder_Button_Save").style.display = "inline-block";
                        document.getElementById("ctl00_MainContentPlaceHolder_Button_CopyRecord").style.display = "inline-block";
                    }
                }
            }
            function refreshPartItemByVendors() {
                __doPostBack('ctl00$MainContentPlaceHolder$rg_PartItemByVendors$ctl01$ctl02$ctl00$ctl02', '');
                document.getElementById("ctl00_MainContentPlaceHolder_Button_Save").style.display = "none";
                document.getElementById("ctl00_MainContentPlaceHolder_Button_CopyRecord").style.display = "none";
            }
            function refreshPartByWarehouses() {
                __doPostBack('ctl00$MainContentPlaceHolder$rg_PartByWarehouses$ctl01$ctl02$ctl00$ctl02', '');
                document.getElementById("ctl00_MainContentPlaceHolder_Button_Save").style.display = "none";
                document.getElementById("ctl00_MainContentPlaceHolder_Button_CopyRecord").style.display = "none";
            }

            function OnCheckedChanged(Check_IsInspectionReq) {

                if (Check_IsInspectionReq.checked == 1) {
                    document.getElementById("RadComboBox_Questionaire").disabled = false;
                }
                else {
                    document.getElementById("RadComboBox_Questionaire").disabled = true;
                }
            }
            function OpnPDFFile() {
                var PDFFilePath = document.getElementById("ctl00_MainContentPlaceHolder_HiddenField_PDFFilePath").value;
                window.showModalDialog(PDFFilePath, "", "status: no; help: no; scroll: no; center: yes ; dialogWidth: 820px; dialogHeight: 600px");
            }

            function ShowPlannerBuyerAndMRPCtlEmployee(strURL) {
                var Role = strURL;
                var PlannerBuyerID;
                var selectedValue
                if (Role == 'IsPlanner') {
                    PlannerBuyerID = document.getElementById("ctl00_MainContentPlaceHolder_RadComboBox_Planner");
                    selectedValue = PlannerBuyerID.control._value;
                }
                else if (Role == 'IsBuyer') {
                    PlannerBuyerID = document.getElementById("ctl00_MainContentPlaceHolder_RadComboBox_Buyer");
                    selectedValue = PlannerBuyerID.control._value;
                }
                else {
                    PlannerBuyerID = document.getElementById("ctl00_MainContentPlaceHolder_RadComboBox_MRPController");
                    selectedValue = PlannerBuyerID.control._value;
                }
                var URL = 'ManagePopup_PlannerBuyerEmployees.aspx?' + Role + '&PlannerBuyerID=' + selectedValue;
                var PopupWindow = radopen(URL, "RadWindow_StatusChange");
                PopupWindow.Center();
            }

            function ViewDetails(SKUNumber, PartItemID, WareHouseID) {
                var oSKUNumber = SKUNumber;
                var oPartItemID = PartItemID;
                var oWareHouseID = WareHouseID;
                var PopupWindow = radopen("ManagePartItemByWareHouseDataView.aspx?SKUNumber=" + SKUNumber + "&PartItemID=" + PartItemID + "&WareHouseID=" + WareHouseID, "RadWindow1");
                PopupWindow.Center();
            }

            function refreshGrid(args) {
                if (args == "RebindPartsByWareHouseGrid") {
                    var grid =  $find("<%= rg_PartByWarehouses.ClientID %>").get_masterTableView();
                    grid.rebind();
                }
            }

            function document.onkeydown() {               
                if (window.event.keyCode == 13) {
                    window.event.keyCode = 9;
                }
            }
            
        </script>

3 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 25 Oct 2013, 10:17 AM
Hello Jitendra,

The function ViewDetails, which to the error is related to, seems fine on a first glance. Can you please try the function with a different caller or try to register the script on an earlier stage of the page cycle?

Looking forward to your reply.

Regards,
Eyup
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Jitendra
Top achievements
Rank 1
answered on 29 Oct 2013, 07:16 AM
Hello Eyup ,

Thanx for the reply.
 its not working, same Script/function run on other pages.
0
Eyup
Telerik team
answered on 01 Nov 2013, 08:45 AM
Hello Jitendra,

Please open a support ticket to send us a sample runnable web site demonstrating the problematic behavior. Thus, we will be able to further analyze and debug the project and suggest a proper solution.

Regards,
Eyup
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
General Discussions
Asked by
Jitendra
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Jitendra
Top achievements
Rank 1
Share this question
or