JqG​​rid 在单击自定义按钮时询问新字段 [英] JqGrid ask for new fields on click custom button

查看:19
本文介绍了JqG​​rid 在单击自定义按钮时询问新字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 jqgrid 的导航器中添加了一个自定义按钮,我想知道当我单击该按钮时,如何显示一个与编辑对话框具有相同样式的对话框,并询问一些不是的特定字段包含在 colModel 中.单击确定按钮时,这些字段将被发送到服务器.

I have added a custom button to the navigator in my jqgrid and i am wondering how can i ,when i click on the button, show a dialog with the same style as the edit dialog and ask for some especific fields that are not included in the colModel. Those field would be to be sent to the server when clicking on ok button.

有什么想法吗?

提前致谢.

卡洛斯.

推荐答案

您可以使用 editGridRow 方法.在方法的第二个 (properties) 参数中,您可以包含您的自定义 beforeShowForm 事件处理程序,可以在对话框中进行任何修改.

You can display the "Edit" dialog using editGridRow method. In the second (properties) parameter of the method you can include your custom beforeShowForm event handler which can make any modifications in the dialog.

查看 答案 例如.demo有一行

See last demo from the answer for an example. The demo has the line

$('<tr class="FormData" id="tr_AddInfo"><td class="CaptionTD ui-widget-content">'+
  '<b>Additional Information:</b></td></tr>').insertAfter (nameColumnField);

beforeShowForm 的内部.

如果您需要在对话框中显示的信息来自网格的隐藏列,您可以使用您找到的简化方式 这里.解决方案的主要思想是jqGrid在表单对话框中包含所有隐藏字段,但相应的行是隐藏的.所以只显示隐藏行就足够了.

If the information which you need to show in the dialog are from the hidden column of the grid you can use simplified way which you find here. The main idea in the solution is that jqGrid include in the form dialog all hidden fields, but the corresponding row is hidden. So it is enough just to show the hidden row.

这篇关于JqG​​rid 在单击自定义按钮时询问新字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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