I am using codeigniter framework with datatables option. In this I need to add condition in the custom add column. For that I need to get value from same query to write condition. Is it possible to get value in controller itself. I need to get export_status
value, and if it is 1 means, I need to hide some options from the add_column
option. Eg: I need to hide the download PDF option. Because I don't know how to get value from the query to write condition. Or I can form this to view file using mRender
option. Below I have given my query.
$this->datatables
->select("sales.id as sid, CONCAT(sales.id, ' ',sales.export_status) as chid, date, reference_no, customer_name, note, delete_status, table_name, count, inv_total, inv_discount, total_tax2, total, internal_note",FALSE);
$this->datatables->join('order_table', 'order_table.id=sales.tableid', 'left');
$this->datatables->from('sales');
$this->datatables->add_column("Actions",
"<center><a href='index.php?module=sales&view=add_delivery&id=$1' title='".$this->lang->line("add_delivery_order")."' class='tip'><i class='icon-road'></i></a>
<a href='index.php?module=sales&view=pdf&id=$1' title='".$this->lang->line("download_pdf")."' class='tip'><i class='icon-file'></i></a>
<a href='index.php?module=sales&view=email_invoice&id=$1' title='".$this->lang->line("email_invoice")."' class='tip'><i class='icon-envelope'></i></a></center>", "sid, internal_note")
->unset_column('sid')
->unset_column('internal_note');
Pls help me guys.Thanks in advance.