Hi Prince,
I have multiple dropdown in durandal widget, and every time before I select value I update DataSource first.
DropDown looks like:
self.dropDownMultiple = {
DataSource: ko.observableArray ([])
fields: someFields,
allowMultiSelection: true,
multiSelectMode "visualMode"
}
I update data source and select value like this:
self.dropDownMultiple.dataSource (data);
var ddI = $ ( '# dropDownMultipleId'). data ( "ejDropDownList");
ddl.selectItemByValue (self.dataObject.relationValue ());
I checked in source code of "ej.dropdownlist", and every time when I update data source on this way: self.dropDownMultiple.dataSource (data)
via knockout binding, source code method "_removeTextBoxValue" is called and this method sets: this._uiInteract = true.
Because of this, your example did not work in may case, It always passes condition.
Now when I tried different way to set data source like:
$ ( '#' + Self.dropDownMultipleId) .ejDropDownList ( "option", "DataSource", data);
It works, method "_removeTextBoxValue" is not called and everything works fine.
Is it ok to set the DataSource on this way?
Is it wrong like I did via knockout binding?
What "option" parameter in setting DataSource (above) mean, I saw example, I am not sure is it neccessary?
regards,
Milos