Enable search column
- Single Page
Posted 17 January 2013 - 19:00 PM
$crud = new grocery_CRUD();
$crud->set_theme('datatables');
$crud->set_table('VOU_VOUCHER');
$crud->set_subject('Vouchers');
$crud->columns('VOU_NUMERO', 'BEN_ID', 'PER_ID', 'VOU_FECHA', 'VOU_FECHA_VALIDEZ', 'VOU_ESTADO');//
$crud->display_as('VOU_NUMERO','VOUCHER Nº')
->display_as('BEN_ID','BENEFICIO')
->display_as('PER_ID','PERSONA')
->display_as('VOU_FECHA','FECHA')
->display_as('VOU_FECHA_VALIDEZ','VALIDEZ')
->display_as('VOU_ESTADO','ESTADO');
$crud->set_relation('PER_ID','PER_PERSONA','{PER_NOMBRE} {PER_APELLIDO}');
$crud->set_relation('BEN_ID','BEN_BENEFICIO','BEN_NOMBRE');
$crud->fields('VOU_ESTADO');
$crud->set_language('spanish');
$crud->field_type('VOU_ESTADO','dropdown',array('N' => 'POR RETIRAR', 'Y' => 'USADO'));
$crud->unset_add()->unset_delete();
$this->data['output'] = $output = $crud->render();
$this->exit('example',$this->data);
Posted 17 January 2013 - 19:42 PM
I think you've got an error when you try do a search by all columns. Or you have the error when you search by one field which has the same name which has another field.
Sorry! My English is poor but I try to use it )))
Posted 17 January 2013 - 19:42 PM
Posted 17 January 2013 - 20:00 PM
My mistake is that I show search fields, print screen show.
Posted 17 January 2013 - 20:04 PM
Your search field in the header of tables
Posted 17 January 2013 - 20:07 PM
[attachment=439:Sin_tÃtulo-1.jpg]
Posted 17 January 2013 - 20:12 PM
Posted 17 January 2013 - 20:13 PM
Posted 17 January 2013 - 20:14 PM
[b] [size=3][font=arial,helvetica,sans-serif]Employees Example[/font][/size][/b]
[color=#000000][b]function[/b][/color] employees_management[color=#66cc66]([/color][color=#66cc66])[/color]
[color=#66cc66]{[/color]
[color=#0000ff]$crud[/color] = [color=#000000][b]new[/b][/color] grocery_CRUD[color=#66cc66]([/color][color=#66cc66])[/color];
[u][b] [color=#0000ff]$crud[/color]->[color=#006600]set_theme[/color][color=#66cc66]([/color][color=#ff0000]'datatables'[/color][color=#66cc66])[/color];[/b][/u]
[color=#0000ff]$crud[/color]->[color=#006600]set_table[/color][color=#66cc66]([/color][color=#ff0000]'employees'[/color][color=#66cc66])[/color];
[color=#0000ff]$crud[/color]->[color=#006600]set_relation[/color][color=#66cc66]([/color][color=#ff0000]'officeCode'[/color],[color=#ff0000]'offices'[/color],[color=#ff0000]'city'[/color][color=#66cc66])[/color];
[color=#0000ff]$crud[/color]->[color=#006600]display_as[/color][color=#66cc66]([/color][color=#ff0000]'officeCode'[/color],[color=#ff0000]'Office City'[/color][color=#66cc66])[/color];
[color=#0000ff]$crud[/color]->[color=#006600]set_subject[/color][color=#66cc66]([/color][color=#ff0000]'Employee'[/color][color=#66cc66])[/color];
[color=#0000ff]$output[/color] = [color=#0000ff]$crud[/color]->[color=#006600]render[/color][color=#66cc66]([/color][color=#66cc66])[/color];
[color=#0000ff]$this[/color]->_example_output[color=#66cc66]([/color][color=#0000ff]$output[/color][color=#66cc66])[/color];
[color=#66cc66]}[/color]
Posted 17 January 2013 - 20:20 PM
the "Flexigrid" is by default. If you need to use the "datatables" theme you should paste this code $crud->set_theme('datatables');
But if you need to use the "flexigreed" theme you don't need this line.
Posted 17 January 2013 - 20:21 PM
Posted 17 January 2013 - 20:23 PM
Posted 17 January 2013 - 20:29 PM
Posted 17 January 2013 - 20:31 PM
Posted 17 January 2013 - 20:32 PM
Salud!
Posted 17 January 2013 - 20:35 PM