<code>
self.dropDownMultiple = {
// Issue occurred in below highlighted case.
dataSource: ko.observableArray([ ]),
fields: { text: "text", value: "value" },
enabled: self.isReadonly,
allowMultiSelection: true,
multiSelectMode: "visualMode",
}
</code> |
Hi Milos,
We have checked your shared sample. Your shared sample button control used. When button click, Model properties values changes will be reflected into dropdownlist. In your case, Model value changes passing with dataSource and enabled properties. So we have use toggle button change event take dropdownlist object enable() and disable() method dropdownlist disabled, but input text clear. Please find the code snippet.
<code>
</code>
Regards,
Gopi G.
S.No |
Details |
1 |
In your shared sample, You have assigned a JSON observable object values into KO Dropdownlist control. In button click, You have change the enable values and in previous you have changed the datasource values as empty array into JSON observable object. This observable object is override the initial rendered. So, The datasource model values changes also be reflected with enable property into dropdownlist. In your case, Model changes passing with dataSource and enabled properties. The dataSource value is be changed when you assigned as ko.observableArray([]). For an empty value, the dropdownlist displays nothing and datasource is not loaded.
So, This is not an issue. It is a behavior of Knockout JS. Please refer to the Knockout JS Documentation link: http://knockoutjs.com/documentation/observables.html |
2 |
In JavaScript , Public method call(enable() / disable()) is not be changed the JSON observable object values. So, Dropdownlist datasource values is not be changed. This is the different between this two scenario. |