I am trying to send custom data to initialize my jqgrid row selection. I want to send the selected row id in the userdata section of the jqgrid ajax xml response.
Here is the xml snippet that I return:
<rows>
<row> ...
</row>
<userdata>
<selNodeId>64</selNodeId>
</userdata>
</rows>
When I ask for the the userData:
var userData = gridTree.getGridParam('userData')
Firebug shows a value of Object { null="64" }
jqgrid seems to parse the userdata xml and then throw away the ‘selNodeId’ identifier. Any ideas as to why the xml does not render an object with the proper ‘selNodeId’ property?
Look at the documentation. You will find that correct format for the
userdatashould beI recommend you if it’s possible to use JSON format instead of XML. In the case almost any data can be read. With respect of
jsonReaderwhich contain methods instead of properties andjsonmapdefined as function you can read practically any JSON data. The format of XML data as jqGrid input have too many restrictions.