在jqgrid中禁用模式弹出窗口 [英] disabling modal popup in jqgrid

查看:118
本文介绍了在jqgrid中禁用模式弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在不使用jqgrid中的模式弹出窗口的情况下创建自定义消息。有没有办法禁用它?或者有没有办法改变模态的内容?

I want to create a custom message without using the modal popup in jqgrid. Is there a way to disable it? Or is there a way to change the contents of the modal?

推荐答案

你能更具体一点吗?如果你想要你自己的模态对话框,你可以添加一个事件处理程序(例如,在一个Edit按钮上),当被触发时会打开你自己的自定义对话框。您可以使用jQuery UI对话框来实现此目的,并将其打开到您自己的自定义表单。

Can you be more specific? If you want your own modal dialog, you could just add an event handler (on an Edit button, for example) that when fired will open your own custom dialog. You can use the jQuery UI dialog for this purpose, and just have it open to your own custom form.

更新
之后检查jqGrid源代码, info_dialog 是用于显示此特定对话框的函数。有一个单独的调用来显示正在加载...弹出窗口。另外,似乎没有一种简单的方法可以禁用 info_dialog 。但是,您可以修改jqGrid源以完成所需的操作。您可以:

Update After inspecting the jqGrid source code, info_dialog is the function that is used to display this particular dialog. There is a separate call to display the "Loading..." popup. Offhand there does not seem to be a simple way to disable info_dialog. However, you could modify the jqGrid source to accomplish what you need. You could either:


  • 立即从 info_dialog 返回 - 这可能是极端,因为它可以报告您需要的其他错误 - 或者,

  • Return immediately from info_dialog - which may be extreme because it could report other errors you need - or,

查找并注释掉显示此特定ajax错误的调用。有一些试验和错误,但只有18个调用此功能,你不会花很长时间追踪。实际上,首先注释掉这个实例,因为它是从ajax调用的错误函数中调用的:

Find and comment out the call that is displaying this particular ajax error. There is some trial-and-error involved, but with only 18 calls to this function it will not take you long to track down. In fact, start by commenting out this instance, since it is called from the error function of an ajax call:

info_dialog(a.jgrid.errors.errcap,e.status +:+ e.statusText +< br />+ u,a.jgrid.edit.bClos​​e);

显然这样的修改是最后的手段,但一旦它起作用,你可以考虑滚动一个补丁为jqGrid团队禁用警报。

Obviously such a modification is a last resort, but once it works you might consider rolling a patch for the jqGrid team to disable the alert.

这篇关于在jqgrid中禁用模式弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆