Display CodeIgniter Profiler in jquery DataTables

Known:

I use Chrome browser

My ajax code :

"ajax": {
            "url": "<?php echo site_url('buy/bajax_transaksi_list')?>",
            "type": "POST",
	}

My CodeIgniter Method:

public function bajax_transaksi_list()
    {
	$this->output->enable_profiler(TRUE);
        $list = $this->mBuy->get_datatables_ubahtransaksi();
}

Wanted:

I want to look my sql query on datatable success result

Question:

How to do that … ?

Answer:

Just add this code to your ajax

  "dataSrc": function ( data ) {
              console.log(data)
   }  

And the full ajax code like this

 "ajax": {
            "url": "<?php echo site_url('buy/bajax_transaksi_list')?>",
            "type": "POST",
	    "dataSrc": function ( data ) {
                 console.log(data)
          } 

Result:

Right click any where inside your page and choose inspect from the pop up menu and this image below will appear:

Run again your web page and after that just follow the explain below

Explain:

  • Choose Network Tab
  • From left panel choose bajax_transaksi_list (choose your ajax url name)
  • From right panel choose Preview tab

Thanks for reading

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *