I was wondering if anyone had come across a solution for wrapping content in a cgridview that has no spaces. Wrapping works fine if the text coming back has spaces in it. But some of content is rather long and doesn’t contain spaces. Is there any way to wrap this or even just show only a certain length of the text until the end of the column.
If all else fails, you could also do your own wrapping:
'value'=>function($data,$row){
if(strlen($data->myField) > 15)
{
// Use the php wordwrap() function or
// your own code (preferably in a model function)
return wordwrap($data->myField,15," ",true);
}
else
{
return $data->myField;
}
},