Globally disable update button after click

4 posts, 0 answers
  1. B
    B avatar
    27 posts
    Member since:
    Aug 2010

    Posted 20 Aug 2014 Link to this post

    We have a situation where our customer's network is slow and when inserting records into a grid, they'll occasionally grow inpatient and click the update button multiple times, resulting in duplicate records being saved.  I know we can set an onclick event and disable the button but I would rather not have to do that on the dozens of grids we have in our application.  Is there an easy way to set this behavior globally?
  2. Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 22 Aug 2014 Link to this post

    Hello Brandon,

    You can use the save event of the Grid that will be triggered immediately after the button is clicked. You can attach extra handler to the update button to prevent its propagation and default behavior.

    Here is a small example:

    http://dojo.telerik.com/@pesho/OtIZ

    If for some reason you want to enable it back then after the request is finished simply remove that handler when the requestEnd event of the datasource is triggered and the type is equal to "update".

    Regards,
    Petur Subev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. Kasi
    Kasi avatar
    1 posts
    Member since:
    Jul 2014

    Posted 17 Jan 2017 in reply to Petur Subev Link to this post

    Hi Petur,

    we used the code mentioned at http://dojo.telerik.com/@pesho/OtIZ. 

    Do you have code sample on how to enable(remove stop proppagation) in back after request finished on requestEnd or onerror. we have a situation where kendoalert message shows up when user enter invalid data. We are getting that message first time and when users click again update button that alert not appearing.  

    Regards

    Kasi

     

     

  4. Viktor Tachev
    Admin
    Viktor Tachev avatar
    2501 posts

    Posted 19 Jan 2017 Link to this post

    Hello Kasi,

    I have replied to your query in the support ticket you have submitted and suggest we continue the conversation there.

    With that said, please avoid submitting duplicate threads. This will enable us to keep better track ot the support history and provide answers faster.

    Regards,
    Viktor Tachev
    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