⚠ 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

add_description() suggestion



mrtakdnz
  • profile picture
  • Member

Posted 15 September 2012 - 23:41 PM

Hi, i want to make a suggestion that i'm sure most people like it.

$this->crud->add_description($column_name, $column_description);

[attachment=284:Untitled-1.jpg]

For now i use this like:

->display_as('post_tags','Column Title <small>column description</small>');

and style it.

I know that i can achieve this with callback function but it will be hard for us to do this for all fields. you know time is money huh ^_^

I'll be appreciated if you add this in new version.

Thanks in advance.

saulimus
  • profile picture
  • Member

Posted 16 September 2012 - 09:09 AM

Maybe a better way to do this would be to modify GCrud to provide the generated field to all the callbacks...
Example:

$crud->callback_field('fieldname', array($this, '_field_callback'));

function _field_callback($value = '', $primary_key = null, $field)
// add a description
$str = '<p>This is a description!</p>';
// add the original field generated by gcrud
$str.= $field;
return $str;
}

mrtakdnz
  • profile picture
  • Member

Posted 16 September 2012 - 09:48 AM

is there a 3rd parameter on callback_filed function? There is no explanation on documentation page about this.

saulimus
  • profile picture
  • Member

Posted 16 September 2012 - 09:55 AM

No, that was just an idea on how to improve the library in the future... the same as yours

mrtakdnz
  • profile picture
  • Member

Posted 16 September 2012 - 12:49 PM

Oh, i just realized. This feature will be great for me.