5 Answers, 1 is accepted
0
Hello Timo,
This is by design. Otherwise calling select method from the onchange handler would lead to recursion.
Why do you need to trigger the change event? Can't you just call the onchange handler manually after calling select?
Regards,
Atanas Korchev
the Telerik team
This is by design. Otherwise calling select method from the onchange handler would lead to recursion.
Why do you need to trigger the change event? Can't you just call the onchange handler manually after calling select?
Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0
JULIA
Top achievements
Rank 1
answered on 01 Sep 2010, 01:59 PM
Hello,
i have four related comboboxes. if there is only one item returned from server for a combobox, this item should be selected and the onchange event should be triggered to fill the next combobox.
Samplecode:
i have four related comboboxes. if there is only one item returned from server for a combobox, this item should be selected and the onchange event should be triggered to fill the next combobox.
Samplecode:
function atcChanged(e) { var sList = $('#Agent_SelectedSupplier').data('tDropDownList'); var agentTextBox = $('#Agent_AutoCompleteAgent').data('tAutoComplete'); getData('<%= Url.Content("~/...") %>', { atcCode: e.value, agent: agentTextBox.text() }, sList); } function supplierChanged(e) { var atcList = $('#Agent_SelectedAtcCode').data('tDropDownList'); var pList = $("#Agent_DropDownProduct").data('tDropDownList'); getData('<%= Url.Content("~/...") %>', { supplier: e.value, atcCode: atcList.value() }, pList); } function getData(url, params, cbx) { $.getJSON(url, params, function (data) { if (data.Data) { cbx.dataBind(data.Data); if (data.Data.length == 1) { cbx.select(0); // trigger onChange } else { ctrl.text(" "); ctrl.open(); } } }); }0
Hello Timo,
If you just want to trigger the ajax loading you can try the reload() JavaScript method of the combobox.
Sincerely yours,
Atanas Korchev
the Telerik team
If you just want to trigger the ajax loading you can try the reload() JavaScript method of the combobox.
Sincerely yours,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0
JULIA
Top achievements
Rank 1
answered on 02 Sep 2010, 08:09 AM
Hello,
reload doesn't run the code in onChange. in this event the comboboxes will be filled with jquery. if there is only one item returned from server this item is selected and the onChange event should be running.
Regards,
Timo
reload doesn't run the code in onChange. in this event the comboboxes will be filled with jquery. if there is only one item returned from server this item is selected and the onChange event should be running.
Regards,
Timo
0
Hello Timo,
Since the select method does not invoke the onchange event I suggest you call the onchange handler manually. I am afraid there is nothing else to do right now.
All the best,
Atanas Korchev
the Telerik team
Since the select method does not invoke the onchange event I suggest you call the onchange handler manually. I am afraid there is nothing else to do right now.
All the best,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items