有没有办法在 jqgrid treeGrid url 请求中传回附加数据?
我使用jqgrid treeview并且我正在传回json响应效果很好。我想将一些有关请求的附加信息传递回 GUI,并且我想了解执行此操作的最佳方法。
我现在能想到的唯一方法是在树状网格中添加另一列并将这些数据推入 json 响应中。
除了填充树的确切响应之外,还有其他方法可以传回附加数据以显示在客户端吗?
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 ??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
与标准网格的情况一样,您可以填充 JSON 数据的
userdata
部分(请参阅 此处了解更多信息)。userdata
的值可以是任何格式的任何对象。在答案中,我使用数据发送有关行的信息( s) 应在网格填满后选择。此外,您还可以使用任何附加信息扩展标准 JSON 数据。该信息将被 jqGrid 忽略,但您可以访问从 loadComplete(data) 事件处理程序。
Like in case of standard grid you can fill the
userdata
part of the JSON data (see here for more information). The value of theuserdata
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.