jqGrid Modal Popup Order of Buttons
How can you change th开发者_如何学Pythone display order of the Submit/Cancel buttons on the jqGrid Modal Popup?
I've been looking for a property in the editGridRow method but haven't had any success.
There are no option which allows you to change the order of the buttons directly, but you can examine the structure of the Edit/Add form and find out that the Submit and Cancel buttons has ids: "sData" and "cData". Both buttons has the same parent. So you can use for example the beforeShowForm event of the editGridRow method in the form
beforeShowForm: function($form){
var cancelButton = $form.parent().find("#cData");
cancelButton.parent().prepend(cancelButton);
}
to place the Cancel button on the first place.
On the demo I use the beforeShowForm
for the row editing. So just select a row and click the Edit button or double click on a row. You will see that the Cancel button are placed before the Submit button.
精彩评论