[eluser]ninjayan[/eluser]
Hello. This is my current code. I'm using ignited datatables
controller:
-----------
Code:
public function get_transaction_types()
{
$this->load->library('datatables');
$this->datatables
->select('name, days', FALSE)
->from('transaction_types')
->add_column("Actions",
"<form id='edit_form' method='post' action='settings/edit_transaction_type/$1' class='left'>
<input type='hidden' value='$1' id='trans_type' name='trans_type' readonly />
<button class='settings-action-btn' title='Update'>
<img src='assets/images/icons/edit.png' alt='Update' />
</button>
</form>
<form id='delete_transaction_type_form' method='post' action='settings/delete_transaction_type/$1' method='post' class='right'>
<input type='hidden' value='$1' id='delete_trans_type' name='delete_trans_type' readonly />
<button class='settings-action-btn' title='Delete'>
<img src='assets/images/icons/delete.png' alt='Delete' />
</button>
</form>",
"name");
echo $this->datatables->generate();
}
views:
------
Code:
$('#transaction_type_table').dataTable({
"sPaginationType": "full_numbers",
"bProcessing": true,
"bServerSide": true,
"bJQueryUI": true,
"bDeferRender": true,
"sAjaxSource": "<?php echo base_url(); ?>/settings/get_transaction_types",
"sServerMethod": "POST",
"aoColumnDefs": [{
'bSortable': false,
'aTargets': [2]
}]
});
I add a simple jquery to the
which is found at the controller and cannot be accessed since its on the controller. Is there a way that I can transfer ingnited datatables code to views?