⚠ 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

How to specify these fields



gavin1211
  • profile picture
  • Member

Posted 04 April 2012 - 14:57 PM

How do you specify a field is:

1. A multi line input box
2. A wysiwyg editor as seen in some of the examples

Thanks

KaBaDaBrA
  • profile picture
  • Member

Posted 04 April 2012 - 15:12 PM


//EXAMPLE CALLBACK
$this->grocery_crud->callback_add_field('address',array($this,'add_field_callback_1'));

//EXAMPLE CALLBACK FUNCTION WITH MULTILINE FIELD
function add_field_callback_1()
{
return '<textarea name="address" rows="15"></textarea>';
}


//EXAMPLE CALLBACK FUNCTION WITH TINY MCE EDITOR
function add_field_callback_1()
{
return '<textarea name="address" class="texteditor"></textarea>';
}

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

Posted 04 April 2012 - 18:05 PM

or you can simply use the unset_texteditor for that.

For example:


$crud->unset_texteditor('description','full_text');


will unset the texteditor. The default text is WITH the texteditor.

If an input is a string and you want to transform it to text with texteditor you can simply do:


$crud->change_field_type('address', 'text');


You can read more about the change_field_type at: http://www.grocerycr...ange_field_type