This question is locked. New answers and comments are not allowed.
Hi, I have 3 cascading comboboxes. On last combobox change i want to show the selected element text but when i run it $("#ComboBox").data("tComboBox") returns me undefined. Can someone tell me what is the problem. Code is following.
<table class="ddtable">
<tr>
<td>
<div class="formlable">Province:</div>
</td>
<td>
<div>
<%= Html.Telerik().DropDownList()
.Name("DropDownList_Province")
.BindTo(new SelectList(Model, "PROV_CODE", "PROV_NAME"))
.Placeholder("Select Province...")
.CascadeTo("DropDownList_Constituency")
%>
</div>
</td>
</tr>
<tr>
<td>
<div class="formlable">Constituency:</div>
</td>
<td>
<div>
<%= Html.Telerik().DropDownList()
.Name("DropDownList_Constituency")
.DataBinding(binding => binding.Ajax().Select("_GetDropDownListConstituency",
"Home"))
.Placeholder("Select Constituency...")
.CascadeTo("DropDownList_PollingStation").HtmlAttributes(new {width = "300px"})
%>
</div>
</td>
</tr>
<tr>
<td>
<div class="formlable">Polling Stations Name:</div>
</td>
<td>
<div>
<%= Html.Telerik().DropDownList()
.Name("DropDownList_PollingStation")
.DataBinding(binding => binding.Ajax().Select("_GetDropDownListPollingStation",
"Home"))
.Placeholder("Select PollingStation...")
.ClientEvents(events => events.OnChange("PollingStation_onChange"))
%>
</div>
</td>
</tr>
</table>
function PollingStation_onChange()
{
var comboBox = $("#DropDownList_PollingStation").data("tComboBox");
alert(comboBox.Text());
}
<table class="ddtable">
<tr>
<td>
<div class="formlable">Province:</div>
</td>
<td>
<div>
<%= Html.Telerik().DropDownList()
.Name("DropDownList_Province")
.BindTo(new SelectList(Model, "PROV_CODE", "PROV_NAME"))
.Placeholder("Select Province...")
.CascadeTo("DropDownList_Constituency")
%>
</div>
</td>
</tr>
<tr>
<td>
<div class="formlable">Constituency:</div>
</td>
<td>
<div>
<%= Html.Telerik().DropDownList()
.Name("DropDownList_Constituency")
.DataBinding(binding => binding.Ajax().Select("_GetDropDownListConstituency",
"Home"))
.Placeholder("Select Constituency...")
.CascadeTo("DropDownList_PollingStation").HtmlAttributes(new {width = "300px"})
%>
</div>
</td>
</tr>
<tr>
<td>
<div class="formlable">Polling Stations Name:</div>
</td>
<td>
<div>
<%= Html.Telerik().DropDownList()
.Name("DropDownList_PollingStation")
.DataBinding(binding => binding.Ajax().Select("_GetDropDownListPollingStation",
"Home"))
.Placeholder("Select PollingStation...")
.ClientEvents(events => events.OnChange("PollingStation_onChange"))
%>
</div>
</td>
</tr>
</table>
function PollingStation_onChange()
{
var comboBox = $("#DropDownList_PollingStation").data("tComboBox");
alert(comboBox.Text());
}