tags:

views:

65

answers:

1

Hi, I need some help with jqGrid. I have a table with the primary key column named 'id'. It seems that there is naming conflict with jqGrid when the inline edit does ajax post back to save data. The rowid used as the unique identifier is also named 'id' in jqGrid.

Is it possible to change the default rowid variable name to something else, such as '_id' to avoid naming conflict? Did I miss something?

A: 

There are different ways to solve your problem.

You can not change the id name used in jqGrid, but you can rename any parameters of ajax requests. For example you can use prmNames: {id:"_id"} option of jqGrid.

If you have a column in the table which has primary key and which can be used to identify a grid row, you can set key: true in the column definition. As a result the column with key: true will be used by jqGrid instead of additional id. Moreover this option can be used also to reduce the size of data (see http://stackoverflow.com/questions/3054463/jqgrid-3-7-does-not-show-rows-in-internet-explorer as an example).

Oleg
I think the first suggestion with prmNames should resolve my issue. The second suggestion is probably the more proper way to resolve the ambiguous naming issue. I will look into it too. Thank you!
Chenster