Server-side implementation

40 views
Skip to first unread message

dgaj

unread,
Feb 1, 2012, 3:45:08 AM2/1/12
to Flexigrid for jQuery
Is there an example anywhere of a server-side implementation for JSON
or at least an explanation beyond what's in the source code?

Thanks

Dean.

Marcos

unread,
Feb 7, 2012, 1:06:02 PM2/7/12
to Flexigrid for jQuery
A very simple server-side script example:

<?php
$data = array(); // this is the array that will be json encoded and
returned to client
$data['page'] = 1; // number of current page
$data['total'] = 5; // total number of rows
$data['rows'] = array(); // array containing the rows to show in grid.
structure of this array follows

$row = array('id' => 1, 'cell' => array("column 1", "column 2",
"column 3", "column n"));

array_push($data['rows'], $row);

echo json_encode($data); // encode data array as json and return it to
the client
?>
Reply all
Reply to author
Forward
0 new messages