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

Custom confirmation popup when batch editing

1 Answer 143 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Andy
Top achievements
Rank 1
Andy asked on 20 Apr 2016, 02:01 PM

How does batch editing work? If I were to create 3 new rows, and hit Save, would the "dataSource.create" function be called 3 times in succession? (first call for first row, etc..)

I would like to have a custom confirmation kendoWindow that pops up when the user hits save. However, the AJAX calls to the serverside should only go through if the user presses the "Yes" button in that pop up. How can I achieve this behaviour? Here's an example 

windowService.displayCurrentWindow("Create"); // popup window
$("#yesButton").click(function () {

    

    windowService.closeCurrentWindow();
    api.post(url, e.data)
        .then(
        function success(response) {
            // do stuff
        },
        function error(response) {
            e.error();
        });
 
})
$("#noButton").click(function () {
    windowService.closeCurrentWindow();
})

1 Answer, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 22 Apr 2016, 08:01 AM

Hello Andy,

My suggestion is to use a custom button in the toolbar. In the click handler you can call the confirmation window and based on the selection either to sync the changes made on the client-side with the server or not. In order to sync changes with the server programatically you can call the sync method of the Kendo UI DataSource. 

Regards,
Boyan Dimitrov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Andy
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Share this question
or