Custom confirmation popup when batch editing

2 posts, 0 answers
  1. Andy
    Andy avatar
    22 posts
    Member since:
    Feb 2016

    Posted 20 Apr 2016 Link to this post

    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();
    })

  2. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    2062 posts

    Posted 22 Apr 2016 Link to this post

    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!
     
Back to Top