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

Undo button for Batch Editing

3 Answers 178 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 07 Dec 2015, 09:08 PM

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

 

 

3 Answers, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 09 Dec 2015, 01:12 PM
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
0
Alexandre
Top achievements
Rank 1
answered on 23 Sep 2020, 12:26 AM

Try this :

 <ClientEvents  OnRowDeleted="RowDeleted"  />

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

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

0
Alexandre
Top achievements
Rank 1
answered on 23 Sep 2020, 12:55 AM

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

Tags
Grid
Asked by
Daniel
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Alexandre
Top achievements
Rank 1
Share this question
or