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.

请参阅从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

如果您需要在对话框中显示的信息是从电网的隐藏的列可以用简化的方式,你觉得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.