I am trying to set the value of my Kendo dropdownList using the code below and expecting the "Change" event to be raise but it doesn't. Can someone please help.
Added additional Code as requested.
HTML Code
<div class="col-md-12 no-padding">
<select id="serviceAccounts"
kendo-drop-down-list
k-ng-model="vm.customer.serviceAccountId"
k-value-primitive="true"
k-options="vm.setServiceAccountOptions" style="width: 100%">
</select>
</div>
Thanks in Advance !
$("#serviceAccounts").trigger("change");
Does not trigger the "change" event of the Kendo DropDownList because
$("#serviceAccounts")
Is not your Kendo DropDownList...it is just a jQuery selector.
You need to get a reference to the actual DropDownList before you can trigger one of its events, i.e.:
var dropDownList = $("#serviceAccounts").getKendoDropDownList();
dropDownList.trigger("change");
Example showing difference between selector.trigger() and dropdownlist.trigger(): http://dojo.telerik.com/@Stephen/UxiLo
Example showing how to trigger the change event using angular widget reference instead of jQuery widget reference: http://dojo.telerik.com/@Stephen/IToFI
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With