问题
i am using jqgrid treeview and i am passing back json response which works great. There is some additional information about the request that i would like to pass back to the GUI and i wanted to see the best way of doing this.
the only way i can think of now is to have another column in the treegrid and shove this data into the json response.
Is there any other way to pass back additional data to display on the client side outside the exact response to populate the tree ??
回答1:
Like in case of standard grid you can fill the userdata
part of the JSON data (see here for more information). The value of the userdata
can be any object in any format. In the answer I used the data to send information about the row(s) which should be selected after the grid are filled.
Additionally you can extend the standard JSON data with any additional information. The information will be ignored by jqGrid, but you have access to the whole data sent from the server inside of the loadComplete(data) event handler.
来源:https://stackoverflow.com/questions/6669540/is-there-anyway-to-pass-back-additional-data-in-jqgrid-treegrid-url-request