⚠ 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

callback_column on a TEXT field.



Raboo
  • profile picture
  • Member

Posted 17 September 2012 - 13:52 PM

Hi,

I'm trying to do this on a sql TEXT column.

$crud->callback_column('comments',array($this,'_callback_fancybox_comments'));

and it goes to this code:

function _callback_fancybox_comments($value,$row)
{
return "<a href=".site_url('main')."/fancybox_comments/$row->node_id class='various fancybox.ajax'>$value</a>";
}


problem is, that without this callback the textfield is snipped short. How can I achieve that when doing a callback and using $value?

midnigther
  • profile picture
  • Member

Posted 17 September 2012 - 19:45 PM

Try it:


function _callback_fancybox_comments($value,$row)
{
return '<div class="text-left" style="width: 100%;"><a href="'.site_url('main').'/fancybox_comments/'.$row->node_id.'" class="various fancybox.ajax">'.$value.'</a></div>';
}

Raboo
  • profile picture
  • Member

Posted 18 September 2012 - 07:18 AM

It made no difference.

Raboo
  • profile picture
  • Member

Posted 18 September 2012 - 07:40 AM

I added these stuff


//This before I do the callbacks, So I don't load them multiple times in the callback.
$this->load->helper('text');

//This in the callback function
character_limiter($value,40)