Hi, Is there a way to fire the clear method of a kendo multiselect via a button click? I have ten multiselects, and need a way to quickly clear them all.
Thanks
Marc
1 Answer, 1 is accepted
0
Accepted
Ivan Danchev
Telerik team
answered on 13 Feb 2017, 09:23 AM
Hello Marc,
The selected value of the MultiSelect can be cleared by calling its value method with an empty string as a parameter. Here's a sample dojo, which demonstrates this.
I think the issue is that my multi select have their own custom onchange events. When I clear the multi select value (using .value("") ), I then fire the change event, which calls my custom event, which updates the multi selects k-ng-model attribute to an empty array. The only thing which isn't happening, is the actual component being rerendered on the screen. Any ideas?
Ivan Danchev
Telerik team
commented on 15 Feb 2017, 07:22 AM
Hello Marc,
Could you please demonstrate the issue with the MultiSelect not being properly rendered in the following dojo, which shows a MultiSelect + Angular scenario? This will allows us to further investigate what causes the unexpected behavior you describe.
Hi Ivan, Its difficult to show you, as the multuiselect is inside an Angular directive. I believe this is the issue, as I have tried watching a scope variable inside my directive, and then using the above answer you gave inside the directive, and this works fine.
I believe this to be quite a unique occurance, and am happy to accept your answer as correct!