datatables ajax loading error from the Zend framework
datatables ajax loading error from the Zend framework
duy_quang422
Posts: 1Questions: 1Answers: 0
'm currently working with Zend frameworks, so I need to use DataTabels. but I'm having trouble.
AdminGroupController.php
public function indexAction(){
$this->view->Title = 'Member :: Group manager :: List';
$this->view->headTitle($this->view->Title,true);
$tblGroup = new Default_Model_UserGroup();
$this->view->Items = $tblGroup->listItem($this->_arrParam, array('task'=>'admin-list'));
$totalItem = $tblGroup->countItem($this->_arrParam);
$data = array_values(array_map('array_values', $this->view->Items));
$json = Zend_Json::encode(array_combine(
array('aaData'),
array($data)
));
$paginator = new Zendvn_Paginator();
$this->view->panigator = $paginator->createPaginator($totalItem,$this->_paginator);
}
index.phtml
id="producttable">
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Extn.</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</table>
products.js
$(document).ready(function() {
$('#producttable').dataTable( {
"bProcessing": true,
"ajax": '/dienthoai/admin-group'
} );
} );
I can't load data. so, everyone please help me
This discussion has been closed.