jqGrid.添加对话框 [英] jqGrid. add dialog

查看:211
本文介绍了jqGrid.添加对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些列的jqGrid,我想在添加"对话框中添加其他字段,这些字段不在网格中显示,但在请求中发送.我该如何使其功能正常?

I have jqGrid with some columns, I want to add additional fields in Add dialog, that not displaying in grid, but sending in request. How i can make this functional?

推荐答案

您可以在此处看到一个工作示例.我将此示例作为对问题"jqGrid:禁用表单字段的回答编辑时" (另请参见)

You can modify Add dialog inside of beforeShowForm event handler. You can see a working example here. This example I made as an answer to the question "jqGrid: Disable form fields when editing" (see also a close question "How to add a simple text label in a jqGrid form?")

已更新:我重新阅读了您的问题,可以看到我最初是按照您的要求回答另一个问题的.您只需要使用 editData 参数即可例如可以像

UPDATED: I reread your question and could see that I answered originally on another question as you asked. What you need is just usage of editData parameter which can be for example like

$("#list").jqGrid('navGrid','#pager',{del:false,search:false,refresh:false},
            {}, // edit parameters
            { // add parameters
                url: '/myAddUrl',
                editData: {
                    someStaticParameter: "Bla Bla",
                    myDynamicParameter: function() {
                        return (new Date()).toString();
                    }
                }
            }
            );

请参见演示.该演示在服务器端没有任何内容,但是您可以通过 Fiddler Firebug ,即发送到服务器的数据包含someStaticParametermyDynamicParameter参数.

see demo. The demo has nothing on the server side, but you can easy verify with Fiddler or Firebug, that the data sent to the the server contain someStaticParameter and myDynamicParameter parameters.

这篇关于jqGrid.添加对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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