Hi there,
im new to php grid and im unable to get it to work. THe grid gets als the fields from the table in his header, but doesnt show any data. Can you pls provide an helping hand ?
Needed js and css files are included in index.php. WIth Jquery 1.10 and 1.9 it doenst show any grid, with 1.8 it shows the grid but no data.
After installing Firefox and Firebug i guess i have an hint. JSON Output looks ok, shows 1 Page at a total of 3 with 51 records, thats ok …
But it throws an JSON Parse Error ….
either you are not adding the $cols array or you are not displaying data in sql command
Is the $cols-Array required ? It doesn't look like this in the "getting started" docs … i dont add it … that should be the point then …. I'll give it a try ….
I'll gave it a shot, and no data anyway ….
this is what i added to my file:
$col = array();
$col["title"] = "ID";
$col["name"] = "id";
$col["width"] = "10";
$cols[] = $col;
$col = array();
$col["title"] = "User";
$col["name"] = "uid";
$col["width"] = "10";
$cols[] = $col;
And in chromedevtools this is the JSON-Response
{"page":"1","total":3,"records":"52","rows":[{"id":"1","uid":"1"},{"id":"2","uid":"2"},{"id":"3","uid":"3"},{"id":"5","uid":"5"},{"id":"6","uid":"6"},{"id":"7","uid":"7"},{"id":"8","uid":"53"},{"id":"9","uid":"9"},{"id":"10","uid":"10"},{"id":"11","uid":"11"},{"id":"12","uid":"12"},{"id":"13","uid":"13"},{"id":"14","uid":"14"},{"id":"15","uid":"15"},{"id":"16","uid":"16"},{"id":"17","uid":"17"},{"id":"19","uid":"19"},{"id":"21","uid":"21"},{"id":"22","uid":"22"},{"id":"23","uid":"23"}]}
but i dont get any data in the grid ….
Hello,
This error usually occur when you have some html code printed before $grid->render() function call, that causes invalid format of json data.
Please recheck OR post the code at [email protected]
Thanks