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

Warn user before losing edit changes (in-line)

4 Answers 95 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jazmin
Top achievements
Rank 1
Jazmin asked on 24 Oct 2016, 08:30 PM

Hello,

We are using Kendo version 2016.2.714. And when you click edit, make some changes and then click edit from another row, you will lose your changes without a confirmation. How can we achieve this confirmation? If possible, it should include when the user clicks another page, or when the user clicks to add a new row (These events makes you lose your in-line edit changes without confirmation).

Also, the simpler the better, as we have to implement this in various places where we use the grid widget.

Thanks in advance!

4 Answers, 1 is accepted

Sort by
0
Maurice
Top achievements
Rank 1
Veteran
answered on 25 Oct 2016, 07:02 AM

maybe not the answer you wnated but this is the way I do it.

.DataSource(datasource => datasource
       .Ajax()
       .AutoSync(enabled: true)

 

Now every change will be synced to the server.

Maurice

 

 

0
Accepted
Viktor Tachev
Telerik team
answered on 26 Oct 2016, 12:26 PM
Hello Jazmin,

I have replied to your query in the support ticket you have submitted. Please submit any additional queries you have there.

For anyone looking for similar functionality, below is a sample that outlines how you can prompt the user before editing a new record.



Regards,
Viktor Tachev
Telerik by Progress
Check out the new UI for ASP.NET Core, the most complete UI suite for ASP.NET Core development on the market, with 60+ tried-and-tested widgets, based on Kendo UI.
0
Katharine
Top achievements
Rank 1
answered on 10 Oct 2017, 04:26 PM
What is the support ticket number?  I would like more information about when the user clicks another page, or when the user clicks to add a new row having a warning message for lost data.  Any direction to information would be greatly appreciated. The warning when another row is edited works great!
0
Viktor Tachev
Telerik team
answered on 12 Oct 2017, 12:37 PM
Hello Katharine,

The tickets are visible only to the person or company that submitted them. However, the solution in the ticket is identical to the one in this post. 

With that said, if you would like to use the same warning when the insert button is clicked you can change the target selector a bit. Check out the modified dojo below that illustrates the approach:


Regarding your other query- if you would like to alert the users that they will lose unsaved changes when closing the page I would recommend handling the onUnload event. In the handler you can check if there are any pending changes in the Grid and if necessary alert the user.


Regards,
Viktor Tachev
Progress Telerik
Try our brand new, jQuery-free Angular 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
Jazmin
Top achievements
Rank 1
Answers by
Maurice
Top achievements
Rank 1
Veteran
Viktor Tachev
Telerik team
Katharine
Top achievements
Rank 1
Share this question
or