⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

auto search issue after loading page, gives directly empty table within a second after completion of page loading



yagnik
  • profile picture
  • Member

Posted 07 February 2015 - 06:15 AM

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

page_1.png

 

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

page_2.png

 

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..