3

I am using the Kendo UI Cascading combo boxes in an MVC 4 application. The source is too complex to post here, however it follows exactly the same structure as the MVC demo on the Kendo UI site (http://demos.kendoui.com/web/combobox/cascadingcombobox.html).

Occasionally I am getting the exception below, I assume this is because the page isn't fully loaded and the user has tried to interact with the page, therefore causing the combo to attempt to submit an AJAX request to get it's data.

Microsoft JScript runtime error: Cannot call method 'value' of kendoDropDownList before it is initialized

Is there a correct way of checking whether Kendo controls are fully initialised ? If not how can I catch this exception ?

Thanks, Jon.

ciantrius
  • 683
  • 1
  • 6
  • 21
  • Please have a look at this page from Telerik, which have some pointers for JS errors http://docs.telerik.com/kendo-ui/troubleshooting – Amal Dev Apr 06 '15 at 09:31

1 Answers1

-1

Make sure load the combo box before you call var val = $("#yourCombobox").value();

if your combobox isn't initialize it gives undefined as the result.

Load the main combo at the $(document).ready() function and then the onchange even of that combo get the value and load the next combo.

tishantha
  • 487
  • 5
  • 13
  • 34