⚠ 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

flexigrid theme search is not working on datatime column



sgoyal

sgoyal
  • profile picture
  • Member

Posted 10 January 2015 - 00:36 AM

Hi Guys,

 

I am having some problems with datetime stamp fields in the flexigrid. I can't use database theme, because of large data in the table. The grid is only in read mode to view data, no editing allowed. I have timestamp field in the grid, but when I am trying to run search filter query on that field it's always returning the 0 records. Even the same is happening on the orders sample example given on the grocerycrud web site (http://www.grocerycrud.com/examples/orders_example). Everything is working fine but don't know how to make search working on the datetime field. Any help to get it resolved will really be appreciated. Here is my controller code:

 

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

$crud->set_theme('flexigrid');
$crud->set_table('webserviceusage');
$crud->fields('companyCode','webserviceCode','clientHost','transactionTimestamp','queryData');
$crud->display_as('companyCode','Company');
$crud->display_as('webserviceCode','Web Service');
$crud->display_as('clientHost','Client Address');
$crud->display_as('transactionTimestamp','Transaction Date');
$crud->display_as('ttime','Transaction Time');
$crud->display_as('queryData','Query Data');
// display recent records first
$crud->order_by('id', 'desc');
// no add, edit or delete allowed for web service code
$crud->unset_add();
$crud->unset_edit();
$crud->unset_delete();
 
$output = $crud->render();
// use templates to build page (common header and footer)
$data['page_header']  = 'includes/session_crud_header';
$data['page_content'] = 'crud_view';
$data['page_footer']  = 'includes/session_footer';
$data['page_title'] = 'Service Usage History';
$data['headerName'] = 'Service Usage History';
$data['jscripts'] = array();
$data['crud'] = $output;
$this->load->view('includes/page_template',$data);

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

 

Thanks,

SG

 


Dogtooth

Dogtooth
  • profile picture
  • Member

Posted 15 January 2015 - 14:38 PM

Hi,

The flexigrid search runs a query against the database. It totally ignores all the work we put into presenting a user friendly table with nice dateformats and real values for boolean stuff.

So when you want to use this search for date or datetime, you have to use the same format in which the date is stored in your database, probably mm-dd-yyyy. Works on the given example.