Beispiel #1
0
 /**
  * Gets the data needed by the flexigrid for customer
  * Ajax call
  * @return JSON
  */
 public function getgriddata()
 {
     $data = $this->input->post();
     $customerService = new CustomerService();
     $criteria = new CriteriaVO();
     $criteria->pageNo = $data['page'];
     $criteria->recordsPerPage = $data['rp'];
     $criteria->sortName = $data['sortname'];
     $criteria->sortOrder = $data['sortorder'];
     $criteria->searchField = $data['qtype'];
     $criteria->searchKey = empty($data['query']) ? null : $data['query'];
     $items = $customerService->fetchCriteriaBased($criteria);
     $itemsCount = $customerService->fetchCountCriteriaBased($criteria);
     $items = $this->transformItems($items);
     $this->load->library('flexigrid');
     Flexigrid::create($items, $criteria->pageNo, $itemsCount);
 }