Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter + Datatables JS
#6

[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>
      &lt;/form&gt;
      &lt;form id='delete_transaction_type_form' method='post' action='settings/delete_transaction_type/$1' method='post' class='right'&gt;
      &lt;input type='hidden' value='$1' id='delete_trans_type' name='delete_trans_type' readonly /&gt;
      <button class='settings-action-btn' title='Delete'>
      <img src='assets/images/icons/delete.png' alt='Delete' />
      </button>
      &lt;/form&gt;",
      "name");
  echo $this->datatables->generate();
}

views:
------
Code:
$('#transaction_type_table').dataTable({
   "sPaginationType": "full_numbers",
   "bProcessing": true,
   "bServerSide": true,
   "bJQueryUI": true,
   "bDeferRender": true,
   "sAjaxSource": "&lt;?php echo base_url(); ?&gt;/settings/get_transaction_types",
   "sServerMethod": "POST",
   "aoColumnDefs": [{
    'bSortable': false,
    'aTargets': [2]
   }]
  });

I add a simple jquery to the
Code:
edit_form
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?


Messages In This Thread
CodeIgniter + Datatables JS - by El Forum - 10-18-2012, 08:52 PM
CodeIgniter + Datatables JS - by El Forum - 10-18-2012, 09:33 PM
CodeIgniter + Datatables JS - by El Forum - 10-18-2012, 09:42 PM
CodeIgniter + Datatables JS - by El Forum - 10-18-2012, 09:46 PM
CodeIgniter + Datatables JS - by El Forum - 10-19-2012, 01:25 AM
CodeIgniter + Datatables JS - by El Forum - 11-11-2012, 11:48 PM



Theme © iAndrew 2016 - Forum software by © MyBB