Ejemplo n.º 1
0
 /**
  * Prepares the data, then fetch and encode to json
  * @return json
  */
 protected function fillgridfinal()
 {
     $response = $this->grid->prepareResponse();
     $result = $this->grid->fetchdata();
     $pkey = $this->model->info('primary');
     foreach ($result as $key => $row) {
         $gridTuplekey = null;
         foreach ($pkey as $num => $col) {
             $gridTuplekey[] = $row[$col];
         }
         $response->rows[$key]['id'] = implode('__', $gridTuplekey);
         $response->rows[$key]['cell'] = array_values($row);
     }
     $this->_helper->json($response);
 }