.net - Setting initial value in a Kendo UI Cascading Combobox with server filtering -
i need make cascading combobox server filtering i'm having trouble setting initial value.
the dropdownlist on combobox depends looks this:
@(html.kendo().dropdownlistfor(model => model.selectedcompany) .name("userdetailselectedcompany") .htmlattributes(new { style = "width:115px;" }) .bindto(model.companylist) .value(model.selectedcompany))
where:
model.selectedcompany
string
- name attribute set because need in combobox (i've read on kendo ui forums i'm not supposed specify it, don't know how cascading combobox without it)
model.companylist
list<string>
an here's combobox:
@(html.kendo().comboboxfor(model => model.selecteddealer) .name("userdetailselecteddealer") .datatextfield("name") .datavaluefield("id") .htmlattributes(new { style = "width:325px" }) .filter(filtertype.contains) .autobind(false) .enable(false) .minlength(3) .datasource(source => source.read(read => read.action("getdealers", "administration").data("administration.getuserdealerparameters")) .serverfiltering(true)) .cascadefrom("userdetailselectedcompany") .selectedindex(model.selecteddealer.id))
where:
model.selecteddealer
dealer
dealer
class containsname
(string) ,id
(int)- mvc action getdealers return json converted
list<dealer>
does have example demonstrate how can work? kendo ui doc has example cascading combobox, server filtering , setting initial value, not 3 @ same time.
you can set text property of combobox. .text(model.selecteddealer)
Comments
Post a Comment