This question is locked. New answers and comments are not allowed.
I have a series of cascading dropboxes that i'm loading on demand using ajax calls. I want to auto-load the controls with their default values when the user hits the page, so i'm trying to call reload on document ready.
I have the controls define as follows:
in my script file for the view, I have the following:
When I run this, Firebug reports that the expression is 'undefined'. When I break down the elements of the expression, $('#template') is defined, but $('#template').data('tDropDownList') is not. If I put the same expression is a button click handler, it works fine.
Do you know what might be happeneing, and what I might be able to do to achieve the same results?
TIA
I have the controls define as follows:
@(Html.Telerik() .DropDownList() .Name("template") .HtmlAttributes(new {style = "width:250px; text-align: left"}) .DataBinding(b => b.Ajax().Select("StartLoadTemplateList", "PlaceOrders")) .ClientEvents(ev => ev.OnChange("OnTemplateChange")) .ClientEvents(ev => ev.OnDataBound("OnTemplateDataBound")) )in my script file for the view, I have the following:
$(document).ready(function () { $('#template').data("tDropDownList").reload();});When I run this, Firebug reports that the expression is 'undefined'. When I break down the elements of the expression, $('#template') is defined, but $('#template').data('tDropDownList') is not. If I put the same expression is a button click handler, it works fine.
Do you know what might be happeneing, and what I might be able to do to achieve the same results?
TIA