JQGrid Edit Form Closing When Click Off Form

2019-07-22 04:32发布

hopefully this is a simple question. In the JQGrid form edit mode, the edit form pops up in the middle of the screen for editing. When I click off of the form, like on the background area, the form closes like I clicked "cancel". I know I can use the "onClose" event to catch this, but I am wondering how I tell the grid not to close unless you click the "cancel" button. I want the editing form to stay there if you click off the form, just close if you click cancel.

I guess I am being a bit lazy, I don't really want to create a modal dialog box that pops up every time it receives the onClose event and asks the user if they really want to stop editing...

Thanks.

2条回答
Ridiculous、
2楼-- · 2019-07-22 04:51

Looks like you can have jqGrid build the dialog with jqModal, and then you should be able to specify the jqModal option to not close the modal when you click the overlay. See the "modal" option on this page: http://dev.iceburg.net/jquery/jqModal/#how

edit you can specify the "modal" option in your jqGrid form setup when the jqModal library is loaded.

查看更多
甜甜的少女心
3楼-- · 2019-07-22 05:15

You can use both modal and jqModal for this problem. Here is the code snippet, I am using in my app:

//-----------------------add options----------------------//
{
width:800,
closeAfterAdd:true, 
reloadAfterSubmit:true,
...
modal:true,
jqModal:true,
....
viewPagerButtons: false,
addCaption: "Add Event",
left:250,
top: 200,
.....
}

I hope this helps...

查看更多
登录 后发表回答