Undo button for Batch Editing

4 posts, 0 answers
  1. Daniel
    Daniel avatar
    2 posts
    Member since:
    Jun 2012

    Posted 07 Dec 2015 Link to this post

    Do you know how to change the text of the undo button when using batch edit delete functionality with the setting HighlightDeletedRows="true".

     

     

  2. Viktor Tachev
    Admin
    Viktor Tachev avatar
    2497 posts

    Posted 09 Dec 2015 Link to this post

    Hi Daniel,

    There is no built-in option for changing the text for the Undo button. However, you can implement the behavior with a bit of custom client-side code. You can handle the click event of the Delete button and change the text in the Undo button.

    The following code-snippet outlines the approach:

    function pageLoad() {
        $telerik.$(".rgMasterTable > tbody tr a").on("click", function () {
     
            var newButtonText = "test";
     
            setTimeout(function () {
                $telerik.$(".rgBatchUndoDeleteButton").html(newButtonText);
            }, 1);
        });
    }


    Regards,
    Viktor Tachev
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Alexandre
    Alexandre avatar
    2 posts
    Member since:
    Nov 2011

    Posted 22 Sep 2020 Link to this post

    Try this :

     <ClientEvents  OnRowDeleted="RowDeleted"  />

     function RowDeleted(sender, eventArgs) {
                             
                                var newButtonText = "test";

                                setTimeout(function () { 
                                    $telerik.$(".rgButtonText").html(newButtonText);
                                }, 1); 
                        }

  4. Alexandre
    Alexandre avatar
    2 posts
    Member since:
    Nov 2011

    Posted 22 Sep 2020 in reply to Alexandre Link to this post

    This work for me:

     

    <ClientEvents  OnRowDeleted="RowDeleted"  />

    function RowDeleted(sender, eventArgs) { 
                                setTimeout(function () { 
                                    $telerik.$(".rgBatchUndoDeleteButton").html('');
                                    $telerik.$(".rgBatchUndoDeleteButton").append('<span class="t-font-icon rgIcon rgBatchUndoDeleteIcon"></span>');
                                    $telerik.$(".rgBatchUndoDeleteButton").append('<span class="t-text rgButtonText">Test</span>'); 
                                }, 1); 
                        }

Back to Top