jqGrid的要求上点击自定义按钮的新领域 [英] JqGrid ask for new fields on click custom button

查看:119
本文介绍了jqGrid的要求上点击自定义按钮的新领域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的jqGrid添加自定义按钮,导航和我想知道如何能我,当我点击按钮,显示一个对话框,相同的样式编辑对话框,并要求一些especific字段不包括在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 方法。在该方法的第二个(属性)参数,您可以包括自定义的 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.

请参阅从<最后的演示href=\"http://stackoverflow.com/questions/4307147/jqgrid-how-to-make-a-column-editable-in-the-add-dialog-but-not-during-inline-e/4308172#4308172\">the回答一个例子。该演示具有行

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

如果您需要在对话框中显示的信息是从电网的隐藏的列可以用简化的方式,你觉得<一个href=\"http://stackoverflow.com/questions/3405029/jqgrid-disable-form-fields-when-editing/3405961#3405961\">here.在该解决方案的主要思想是,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.

这篇关于jqGrid的要求上点击自定义按钮的新领域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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