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

[Solved] $("#ComboBox").data("tComboBox") returns undefined

1 Answer 15 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Zeb
Top achievements
Rank 1
Zeb asked on 27 Jan 2013, 01:29 PM
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());
}

1 Answer, 1 is accepted

Sort by
0
Zeb
Top achievements
Rank 1
answered on 27 Jan 2013, 02:38 PM
Ohhh i found the answer actully its not tComboBox it's tDropDownList.
Tags
General Discussions
Asked by
Zeb
Top achievements
Rank 1
Answers by
Zeb
Top achievements
Rank 1
Share this question
or