Search code examples
mvvmkendo-uicascadingdropdown

How update dropdownlist to default value


I have 2 dropdownlist cascade.

I use MVVM.

user story:

  1. select value from first DDL (automatically enable second DDL and push data)
  2. select value from second DDL
  3. click ADD (add value field in datasource in model)

it's work.

I need update first DDL to default value ("Select...") and automatically disable second DDL but first DDL is default..

How do this?


Solution

  • first DDL have ID = "myFirstDDL" . Then

    var firstDDL = $('#myFirstDDL').data('kendoDropDownList');// kendo object
    firstDDL.dataSource.read(); // re-new data from Your Server - if you need this.
    firstDDL.select(0);//update first DDL to default value ("Select...") and automatically disable second DDL