public function invoice_data($invoice_id = NULL)
{
$output = array();
$crud = new grocery_CRUD();
$crud->set_table('invoice');
$crud->set_subject('Invoice Data');
$crud->columns('id','suborder_id','sku_code','awb_number','amount');
$crud->where('added_by',$this->session->userdata('userid'));
if($invoice_id)
{
$crud->where('invoice_id', $invoice_id);
}
$crud->unset_add();
$crud->unset_edit();
$crud->unset_read();
$data = $crud->render();
$data->invoice_id = $invoice_id;
$data->page = "invoice";
$this->load->view('header',$data);
$this->load->view('invoice_data_view',$data);
$this->load->view('footer',$data);
}
1) first image shows data for a second while loading page

2) This second screen shot shows a empty table just after completion of loading page (after call first auto ajax search call)

I don't know how to manage it, I already do clear filtering, refresh searching, but finally solve this issue by commenting below line which is placed in "if" condition, but I want it with "IF" condition anyhow, So help me asap..
//$crud->where('invoice_id', $invoice_id);
Thank you for your given time in advance..
