kendo ui - changing Datasource of Kendoui Multiselect at runtime -
i bind data kendoui multiselect @ runtime. example suppose want bind cascade of drobdownlist. idea?
<p> <label for="categories">catergories:</label> @(html.kendo().dropdownlist() .name("categories") .htmlattributes(new { style = "width:300px" }) .optionlabel("select category...") .datatextfield("categoryname") .datavaluefield("categoryid") .datasource(source => { source.read(read => { read.action("getcascadecategories", "coreparam"); }); }) .events(e =>e.select("select")) ) </p> <p> <label for="parameters">parameters:</label> @(html.kendo().multiselect() .name("parameters") .htmlattributes(new { style = "width:400px" }) .datatextfield("paramdesc") .datavaluefield("paramcode") .placeholder("select products...") .datasource(source => { source.read(read => { read.action("getcascadeparams", "coreparam") .data("filterparams"); }) .serverfiltering(true); }) .autobind(false) ) </p> <script type="text/javascript"> function filterparams() { return { categories: $("#categories").val() }; } function select(e) { var dropdownlist = $("#categories").data("kendodropdownlist"); dropdownlist.select(e.item.index()); var multiselect = $("#parameters").data("kendomultiselect"); multiselect.datasource.read(); }; </script>
Comments
Post a Comment