asp.net mvc - Why is CascadeFrom() not doing anything? -
i'm new kendo ui, , i'm having problems cascadefrom() not calling action on controller. here's bare bones of problem:
// parent dropdown <select id="testing"> <option value="0">vehicle</option> <option value="1">driver</option> <option value="2">trailer</option> </select> // dynamic dropdown @(html.kendo().dropdownlistfor(m => m.vdtid) .datavaluefield("id") .datatextfield("item") .datasource(ds => { ds.read(c => c.action("getvdt", "companyvdtunavailability") .data("getvdtselection")) .serverfiltering(true); }) .cascadefrom("testing")) // function allow kendo pass value // type parameter of getvdt action. function getvdtselection() { homecoming { type: parseint($("#testing").val()) }; } the action beingness called when page first loads, , returns right data. problem is, if create selection testing dropdown, action never invoked on controller (i've verified using breakpoint on action), meaning dynamic dropdown never gets updated.
looking through official example, , other questions around so, can't see i'm doing wrong. point me in right direction, please?
edit: i've tried petur's solution below changing parent dropdown following:
@(html.kendo().dropdownlistfor(m => m.type) .name("testing") .datavaluefield("id") .datatextfield("text") .bindto(model.unavailabilitytypes)) this binds parent dropdown correctly, no longer invokes controller action cascading dropdown when page first loads. suggestions?
controller action signature requested:
public jsonresult getvdt(companyunavailabilitytype type) where companyunavailabilitytype enum.
kendo dropdownlist can cascade kendo dropdownlist/combobox. turn first widget kendo dropdownlist , should start working properly.
asp.net-mvc kendo-ui kendo-asp.net-mvc cascadingdropdown
No comments:
Post a Comment