tonytomov/jqGrid — pull request #404 by OlegKi (2013-01-06 15:31:00+00:00)
Title: postData for building selects using dataUrl

Hi Tony,

I read regularly the requirement to send some additional information to the `dataUrl` needed to construct `` in for data editing. The problem is that in some scenarios one have practically no additional possibility to modify `dataUrl` before the request to `dataUrl` will be sent. For example [the answer](http://stackoverflow.com/a/13913788/315935) described the workaround in case of usage `formatter: "actions"`.

Small changes which I prepared as pull request allows to solve the problem in very easy way. After the suggested modification one can use `editoptions.postData` or `ajaxSelectOptions.postData` for the purpose. For example as

ajaxSelectOptions: {
postData: function (rowid, value, colName) {
return { id: rowid, val: value, col: colName };
}
}

or as

editoptions: {
dataUrl: "/Home/GetSelectData",
postData: function (rowid, value, colName) {
return { id: rowid, val: value, col: colName };
}
}

If required one can use `rowid` to get and post some other context specific information from the grid.

The modified method `$.jgrid.createEl` will be used from jqFilter too. In the same `rowid` will be set to the random value `$.jgrid.randId()`. Because of that I suggest don't use the suggested functionality in case of searching.

Best regards
Oleg