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

Customize Update/cancel button in popup edit mode

3 Answers 1320 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Erlend
Top achievements
Rank 2
Erlend asked on 28 Aug 2012, 06:56 AM
Hi, 

Is there a way to customize buttons in the grid popup editmode?

I have looked through code for creating the popup window and it seems that the buttons are appended regardless to the html before creating the window.
ie.: 
html += that._createButton("update") + that._createButton("canceledit");
            html += '</div></div>';

I want to change to position, icons and text but keeping the functionality.

I tried changing content on open event, but this seems not to be the best approach.
i.e: 
 open: function (e)
        {
          // TODO: fikse knapper: 
          // debugger;
          var content = $(e.sender.content());
          content.find(".popup-fieldset-wrapper").append(content.find(".k-button"));
          content.find(".k-button").wrapAll("<div class='buttons' style='float: right;'/>");
          content.find(".k-button.k-grid-update").addClass("save");
          content.find(".k-button.k-grid-cancel").addClass("cancel");
          e.sender.content(content); //at first i was converting content back to html(), but seems much better when just putting the jQuery object into content. 
          //          e.sender.center();
        }

However this method looses the mvvm binding and the widgets looses its functionality!
Any help appreciated.

3 Answers, 1 is accepted

Sort by
0
Ross
Top achievements
Rank 1
answered on 24 Sep 2012, 08:11 PM
I have the same need.  I need to right justify the update/cancel buttons on my edit popup from a kendo grid.  Anyone?
0
Jon
Top achievements
Rank 1
answered on 24 Jan 2013, 08:44 PM
I have very similar needs, in that I want to apply some styles/class to the Update and Cancel buttons on the pop up editor form.  Any thoughts?
0
Alexander Valchev
Telerik team
answered on 29 Jan 2013, 12:03 PM
Hello guys,

The text of the controls in popup/editing mode can be customized through the configuration options. For more information and code sample please check this help topic.

If you want to attach specific class name or inline style you may hook up to the edit event of the Grid and use jQuery. As an example:
edit: function(e) {
    e.container.find(".k-button.k-grid-update"); //update button
    e.container.find(".k-button.k-grid-cancel"); //cancel button
}

I hope this information will help.

Regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Kenn.
Top achievements
Rank 1
Iron
commented on 16 Feb 2022, 02:56 PM

Your link to the help topic has died. 
Martin
Telerik team
commented on 21 Feb 2022, 11:00 AM

Tags
Grid
Asked by
Erlend
Top achievements
Rank 2
Answers by
Ross
Top achievements
Rank 1
Jon
Top achievements
Rank 1
Alexander Valchev
Telerik team
Share this question
or