How to cancel changes of one field in one item in the DataSource?

2 posts, 0 answers
  1. Salim
    Salim avatar
    28 posts
    Member since:
    Jun 2016

    Posted 07 Oct Link to this post

    Is there a way to cancel the changes of one field in one item in the DataSource?

    Let us say that the user is modifying in the grid one item and he wants to cancel the changes of this item (one specific field) and not all his changes in the grid, can this be done?

  2. Alex Hajigeorgieva
    Admin
    Alex Hajigeorgieva avatar
    115 posts

    Posted 10 Oct Link to this post

    Hi Salim,

    The required functionality is not available out of the box, however, you may be able to implement it with some custom coding and utilising the save event of the Kendo UI Grid as well as a custom column editor. Below are the steps I took to make this implementation possible:

    - create the required input field with a cancel button by adding the columns editor setting:

    http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#configuration-columns.editor

    - add a boolean value whether the button was clicked via mousedown
    - attach an event handler function to the save event of the Kendo UI Grid and call the preventDefault() method if the cancel button mousedown event call evaluates to true
    - remember to change the boolean value within the handler function

    For your convenience, a runnable demo is available at:

    http://dojo.telerik.com/OjOqA

    Regards,
    Alex
    Telerik by Progress
     
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
  3. Kendo UI is VS 2017 Ready
Back to Top