[eluser]benton.snyder[/eluser]
Controller:
Code:
public function get_tickets()
{
$this->load->model('tickets');
echo json_encode($this->tickets->listTickets(NULL, TRUE));
}
View:
Code:
[removed][removed]
<link href="<?=$this->config->base_url();?>includes/datatables/css/jquery.dataTables.css" type="text/css" rel="stylesheet" />
[removed]
$(document).ready(function() {
// initialize tickets datatable
oTable = $('#tickets').dataTable( {
"sScrollX": "100%",
"sScrollXInner": "100%",
"bProcessing": true,
"bServerSide": true,
"bJQueryUI": true,
"sAjaxSource": '<?=$this->config->site_url();?>/main/get_tickets'
} );
[removed]
<div id="datatables">
<table id="tickets">
<thead>
<tr>
<th>ID</th>
<th>Last Update</th>
<th>Created</th>
<th>Priority</th>
<th>Subject</th>
<th>Description</th>
<th>Flagged</th>
<th>Owner</th>
<th>Group</th>
</tr>
</thead>
<tbody>
<tr>
<td>Row 1 Data 1</td>
<td>Row 1 Data 2</td>
<td>Row 1 Data 3</td>
<td>Row 1 Data 4</td>
<td>Row 1 Data 5</td>
<td>Row 1 Data 6</td>
<td>Row 1 Data 7</td>
<td>Row 1 Data 8</td>
<td>Row 1 Data 9</td>
</tr>
</tbody>
</table>
</div>