tags:

views:

37

answers:

1

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?

A: 

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?")

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();
                    }
                }
            }
            );

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.

Oleg