开发者

jqGrid Modal Popup Order of Buttons

开发者 https://www.devze.com 2023-03-15 10:00 出处:网络
How can you change th开发者_如何学Pythone display order of the Submit/Cancel buttons on the jqGrid Modal Popup?

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消