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

How to change Update and Cancel button templates on Inline Editing mode

3 Answers 698 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Erwin Francis
Top achievements
Rank 1
Erwin Francis asked on 19 Sep 2012, 04:08 AM
I've been pulling my hair on how to change the template of the Update and Cancel buttons. I was able to change the default Edit and Delete buttons but I don't know where to set the configuration to change the Update and Cancel buttons after it swtiches when I click the Edit button.

Here's the code where I changed the template for the Edit and Delete buttons:

columns:[
            {title:"Property", field:"property_name",  width:80},
            {title:"Data Type", field:"property_data_type", editor:loadDataType, width:80},
            {command:[{ name: "destroy", text: "Delete", template: "<a class=\"btn btn-danger\"><i class=\"icon-chevron-down icon-white\"></i></a>"},{ name: "edit", text: "Edit", template: "<a class=\"btn btn-primary k-grid-edit\"><i class=\"icon-pencil icon-white\"></i></a>"}] , width:80},
        ],

The Update and Cancel buttons replaces the Edit and Delete buttons when I click on the Edit button. Is there somewhere I can also set the template for the Update and Cancel buttons?

Please help, Thanks.

3 Answers, 1 is accepted

Sort by
0
Erwin Francis
Top achievements
Rank 1
answered on 19 Sep 2012, 06:34 AM
Nevermind guys, I figured it out. But to those having the same issue as I was all you need to do is add this:

edit: function(e) {
            var commandCell = e.container.find("td:last");
            commandCell.html('<a class="btn btn-primary k-grid-update">Update</a><a class="btn btn-danger k-grid-cancel">Cancel</a>');
        }
0
M
Top achievements
Rank 1
answered on 20 Nov 2012, 05:54 PM
Hi,

Can you let me know where you are placing edit: function(e){...

I'm wanting to customize all the edit/update/cancel buttons for inline grid editing (they take up too much space).

Thanks
0
M
Top achievements
Rank 1
answered on 20 Nov 2012, 05:58 PM
It's okay -- simple enough,  just add it to the grid definition.

Thanks
Tags
Grid
Asked by
Erwin Francis
Top achievements
Rank 1
Answers by
Erwin Francis
Top achievements
Rank 1
M
Top achievements
Rank 1
Share this question
or