Clear Function

7 posts, 1 answers
  1. Marc
    Marc avatar
    171 posts
    Member since:
    Sep 2016

    Posted 13 Feb 2017 Link to this post

    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

  2. Answer
    Ivan Danchev
    Admin
    Ivan Danchev avatar
    2104 posts

    Posted 13 Feb 2017 Link to this post

    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.

    Regards,
    Ivan Danchev
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Marc
    Marc avatar
    171 posts
    Member since:
    Sep 2016

    Posted 13 Feb 2017 in reply to Ivan Danchev Link to this post

    Hi Ivan,

    That is perfect, thank you so much!

    Marc

  4. Marc
    Marc avatar
    171 posts
    Member since:
    Sep 2016

    Posted 13 Feb 2017 in reply to Ivan Danchev Link to this post

    Hi Ivan. Some of my dropdowns are created using AngularJS.

    <select kendo-multi-select
    multiple="multiple"
    id="categoryMultipleSelect">

    Is there something special I need to do to clear these, as your solution does not appear to work in this case?

    Thanks!

  5. Marc
    Marc avatar
    171 posts
    Member since:
    Sep 2016

    Posted 14 Feb 2017 in reply to Ivan Danchev Link to this post

    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?
  6. Ivan Danchev
    Admin
    Ivan Danchev avatar
    2104 posts

    Posted 15 Feb 2017 Link to this post

    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.

    Regards,
    Ivan Danchev
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  7. Marc
    Marc avatar
    171 posts
    Member since:
    Sep 2016

    Posted 15 Feb 2017 in reply to Ivan Danchev Link to this post

    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!

    Thanks,

    Marc

Back to Top