This is a migrated thread and some comments may be shown as answers.

Globally disable update button after click

3 Answers 217 Views
Grid
This is a migrated thread and some comments may be shown as answers.
B
Top achievements
Rank 1
B asked on 20 Aug 2014, 03:06 PM
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?

3 Answers, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 22 Aug 2014, 10:21 AM
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.

 
0
Kasi
Top achievements
Rank 1
answered on 17 Jan 2017, 05:01 PM

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

 

 

0
Viktor Tachev
Telerik team
answered on 19 Jan 2017, 12:51 PM
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.
Tags
Grid
Asked by
B
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Kasi
Top achievements
Rank 1
Viktor Tachev
Telerik team
Share this question
or