Change event (=selection changed) fires on programatically selection changes

5 posts, 0 answers
  1. Ricky
    Ricky avatar
    18 posts
    Member since:
    Aug 2016

    Posted 04 May 2017 Link to this post

    Hello,

    the change event in the grid handles selection changes.

    This works fine but when I use grid.select(...) to select rows programatically, this also fire the change event. That is not desired and not the case for other controls. You cannot distinguish programatic changes from user changes this way (while you could always call a shared function from the change-event-handler and the programmatic change if required)!

    Is this by design or a fix? Can it be influenced?

  2. Stefan
    Admin
    Stefan avatar
    2834 posts

    Posted 08 May 2017 Link to this post

    Hello Ricky,

    Currently, the mentioned behaviour is expected as the selection is actually changed.

    In this scenario, I can suggest using a flag to determine if the event is triggered after programmatically changing the selection. Then based on the flag to execute or not the desired code on the changed event.

    Regards,
    Stefan
    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. Ricky
    Ricky avatar
    18 posts
    Member since:
    Aug 2016

    Posted 08 May 2017 Link to this post

    This is a confusing as other controls does not work this way but if this is what you think it should be...
  4. Ricky
    Ricky avatar
    18 posts
    Member since:
    Aug 2016

    Posted 08 May 2017 Link to this post

    This is confusing as other controls (e.g. DropDownList, see http://docs.telerik.com/kendo-ui/api/javascript/ui/dropdownlist#events-select) do not work this way. Not firing the event when setting programatically or having a flag in the event arguments should be the way to go.
  5. Stefan
    Admin
    Stefan avatar
    2834 posts

    Posted 10 May 2017 Link to this post

    Hello Ricky,

    Thank you for the feedback.

    I will forward this to the developer's team.

    As for the DropDownList, we especially added this as an important note as usually, firing the change event in this scenario is expected.

    Regards,
    Stefan
    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.
Back to Top