First of all I find your question very interesting, so +1 for the question. What you find out can be really large problem which can be difficult diagnosed. So I recommend you to place the corresponding suggestion in the feature request on http://www.trirand.com/blog/?page_id=393/feature-request/.
Now about the workaround possibilities. The easiest way is to generate an unique Ids for different grids on the server side. But it is of cause not always possible. You can add an id_prefix
as an additional parameter of your server code which produce JSON/XML reply from jqGrid. Then server should add this prefix to all ids before sending back to jqGrid. This workaround is not nice but it will work.
Another way which I see is the changing of id of all jqGrids rows with respect of jsonReader
(see http://www.trirand.com/jqgridwiki/doku.php?id=wiki:retrieving_data#jsonreader_as_function). If you add to the jqGrid the parameter like following:
jsonReader: { id: function(obj) { return "BlaBla" + obj.id; } }
then all ids in the table will receive prefix "BlaBla". If you use jqGrids on your page only to display data in the grid this can be your solution. You should don't forget about possible new problems which produce this workaround. If you use master/detail scenario, Edit/Delete etc you have to take in consideration, that ids of grids will have prefixes now. So you will have to include additional code in evens like onclickSubmit
, serializeRowData
, serializeGridData
and so on to cut the prefix before the usage of id or before sending ids to the server.