⚠ 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

enum and set field_type doesn't work



macphisto
  • profile picture
  • Member

Posted 18 May 2012 - 20:18 PM

enum and set field_type doesn't work!!!
I try like this:
$crud->change_field_type('test','enum', array('test','test1','test2'));
$crud->change_field_type('test','set', array('test','test1','test2'));

but it didn't work!

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 18 May 2012 - 21:45 PM

This is already tracked - https://github.com/scoumbourdis/grocery-crud/issues/27 .

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 19 May 2012 - 14:56 PM

And fixed at: https://github.com/scoumbourdis/grocery-crud/commit/0ef184ef363d1898d316b248ab161f1db2792611

macphisto
  • profile picture
  • Member

Posted 19 May 2012 - 18:22 PM

thank you very much :)

macphisto
  • profile picture
  • Member

Posted 19 May 2012 - 18:31 PM

Can I load to enum or set data from DB?

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 19 May 2012 - 22:43 PM

Of course you can ;)

grocery CRUD auto-generates the select and multiselect for enum and set fields

macphisto
  • profile picture
  • Member

Posted 20 May 2012 - 15:59 PM

thanx it works fine :) Tell me another think. I have two field: name and seo_name, and I would like to seo_name field is automatically filled by a function jquery.
for example when I type in name field "Product Xyz" , seo_name automatically filled by "product_xyz".

richardsy
  • profile picture
  • Member

Posted 11 September 2012 - 21:33 PM

This looks like it works in 1.3.1 but fails to save in database. When will this be supported?
$crud->change_field_type('Enabled', 'enum', array( 0 => 'Disabled', 1 => 'Enabled' ));

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 15 September 2012 - 19:09 PM

[quote name='richardsy' timestamp='1347399200' post='3368']
This looks like it works in 1.3.1 but fails to save in database. When will this be supported?
$crud->change_field_type('Enabled', 'enum', array( 0 => 'Disabled', 1 => 'Enabled' ));
[/quote]
This will be the "dropdown" field type but there is not such a feature right now so you can only use the "enum" for now and then add a callback_insert and callback_update