⚠ 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

Enable search column



Luciano Blazquez
  • profile picture
  • Member

Posted 17 January 2013 - 19:00 PM

Hello, I have a problem. I do the same example of "employees_example" that is in place, the problem is that I search columns appear.

$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);

victor
  • profile picture
  • Member

Posted 17 January 2013 - 19:42 PM

what an error do you have? All fields need to have an uncial name!
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 )))

victor
  • profile picture
  • Member

Posted 17 January 2013 - 19:42 PM

Oh )) Welcome to the forum ))

Luciano Blazquez
  • profile picture
  • Member

Posted 17 January 2013 - 20:00 PM

Thanks Victor!
My mistake is that I show search fields, print screen show.

victor
  • profile picture
  • Member

Posted 17 January 2013 - 20:04 PM

because you use the "datatables" theme.
Your search field in the header of tables :)

victor
  • profile picture
  • Member

Posted 17 January 2013 - 20:07 PM

Have look at this:
[attachment=439:Sin_título-1.jpg]

Luciano Blazquez
  • profile picture
  • Member

Posted 17 January 2013 - 20:12 PM

and that theme should I use? thanks Victor!!

victor
  • profile picture
  • Member

Posted 17 January 2013 - 20:13 PM

Delete this line and be happy )) $crud->set_theme('datatables');

Luciano Blazquez
  • profile picture
  • Member

Posted 17 January 2013 - 20:14 PM

[b] [size=3][font=arial,helvetica,sans-serif]http://www.grocerycrud.com/examples/employees_example[/font][/size][/b]

[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]

victor
  • profile picture
  • Member

Posted 17 January 2013 - 20:20 PM

You can delete it.
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.

victor
  • profile picture
  • Member

Posted 17 January 2013 - 20:21 PM

You can take look at another examples and you will see that.

Luciano Blazquez
  • profile picture
  • Member

Posted 17 January 2013 - 20:23 PM

Need the following functionality, the possibility exists?

victor
  • profile picture
  • Member

Posted 17 January 2013 - 20:29 PM

those theme have no this functionality. But the "flexigreed" can look for on each field separately.

victor
  • profile picture
  • Member

Posted 17 January 2013 - 20:31 PM

sorry) I go to the shop to buy some beer)

Luciano Blazquez
  • profile picture
  • Member

Posted 17 January 2013 - 20:32 PM

Ohhh.. =( ... Tenks Victor!!

Salud!

victor
  • profile picture
  • Member

Posted 17 January 2013 - 20:35 PM

it's will be in future versions of this library