How do you return additional data to jqGrid from the server?

I want to show the general meaning of the elements displayed in jqGrid on my page. The only way I can think of is to have the server return it with the grid data, but not sure how to intercept it on arrival requested by jqGrid.

+4
source share
1 answer

You can use userdata .

Add userdata to your server. JSON answer:

 {"total":"","page":"","records":"","rows":[],"userdata":{"custom_field":"custom_value"}} 

And then you can get the custom_field value inside your loadComplete tables:

 custom_value = $('#table_id').getGridParam('userData').custom_field; 
+3
source

Source: https://habr.com/ru/post/1379143/


All Articles