I am using Zend Framework that’s why I decided to use “zfdatagrid deploy jqgrid” instead of using jqgrid straight away.
I want to have jqgrid with subgrid. Grid is shown ok, but when I click expand button then I get notice “Loading” but nothing happens. I have debugged that “subGridUrl” is called correctly, because debugger hit function where I should select data from MySQL for subgrid, and I tried to pass pure json response (instead of selecting from MySQL) but still subgrid is not shown. Maybe I don’t understand what response must be? My response:
<...>
$responce = new stdClass();
$responce->rows[0]['id']='0';
$responce->rows[0]['cell']=array('0','test1','123','1');
$responce->rows[1]['id']='1';
$responce->rows[1]['cell']=array('1','test2','321','2');
$j = json_encode($responce);
echo $j;
<...>
Sorry, my bad. But instead of deleting my question, I will explain my mistake incase somebody else will do the same…
I made a mistake declaring “subGridModel”. Instead using array:
I wrote string:
And that’s why it did not work in javascript.
By the way, you can see that I wrote array in array. That is because with one array ZFDataGrid generates such javascript:
instead of this:
It is important for jqgrid subgrid to work!