Hi,
This is example of loading json from the forum.
You can fetch this data from database using php-mysql standard functions and convert it in php array. This array can be supplied as datasource for grid.
To load grid from array, you can review demos/loading/load-array.php
Demo: https://gist.github.com/gridphp/af7ce29b851a125ad0af787ddd4d1dba
I have postgres database with id,json as database field containing json data like the sample above.
How can I save it using the rest events?
Or is there simple way to edit the json on the grid. (Current it does not let you)
Q
Search google found this:
https://phpgrid.com/example/json-data-source/
Save local array back to database
I think same thing can be done with grid php.
Having sample will be great!
Yes, You can refer this demo:
Demo: https://gist.github.com/gridphp/af7ce29b851a125ad0af787ddd4d1dba
Most likely you need to first fetch the data from database using some query: e.g.
$g = new jqgrid(..); $rs = $g->get_all("SELECT id,json FROM tab");
and then iterate on $rs and load json to data array of grid.
To insert, update, delete these values, Please refer callback events: