$responce = new StdClass;//php5以上版本使用
$responce->page = $page;
$responce->total = $total_pages;
$responce->records = $count;
$i = 0;
while($i < count($alldata))
{
$responce->rows[$i]['id'] = $i;
$responce->rows[$i]['cell'] = array(‘a’, 'b');
$i++;
}
echo json_encode($responce);
jqgrid的datatype是json就OK了