简体   繁体   English

单击关闭表单后,JQGrid编辑表单关闭

[英]JQGrid Edit Form Closing When Click Off Form

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. 在JQGrid表单编辑模式下,编辑表单会在屏幕中间弹出以进行编辑。 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. 我知道我可以使用“ onClose”事件来捕获此事件,但是我想知道如何告诉网格不要关闭,除非您单击“取消”按钮。 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... 我想我有点懒惰,我真的不想创建一个模态对话框,每次收到onClose事件时都会弹出该对话框,并询问用户是否真的要停止编辑...

Thanks. 谢谢。

You can use both modal and jqModal for this problem. 您可以同时使用modaljqModal来解决此问题。 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... 我希望这有帮助...

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. 看起来您可以让jqGrid使用jqModal构建对话框,然后您应该能够指定jqModal选项,以在单击叠加层时不关闭模式。 See the "modal" option on this page: http://dev.iceburg.net/jquery/jqModal/#how 请参阅此页面上的“模态”选项: 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. 编辑时 ,可以在加载jqModal库时在jqGrid表单设置中指定“模式”选项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM