⚠ 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 forum is read-only and soon will be archived. ⚠

Multiple lines in a text column

columns text

  • Please log in to reply
4 replies to this topic

#1 wildfandango



  • Members
  • PipPip
  • 24 posts

Posted 11 October 2017 - 03:42 PM

Hello everyone


I have a large TEXT type field, in GRID mode only the first N characters are shown about 50 and "..." I would like to show all the text lines in that field.

Any ideas?


please I'm pretty lost ... :(


#2 larasmith


    Advanced Member

  • Members
  • PipPipPip
  • 200 posts

Posted 12 October 2017 - 12:14 AM

Hi there... the text are not displayed as a whole in the column view. 


You can see it all during editing or adding of record.


Where do you want to see it fully?

#3 cletourneau



  • Members
  • PipPip
  • 15 posts

Posted 12 October 2017 - 02:40 PM

If you want to display all your text in the grid, I suggest you use callbackColumn. You will be able to create your own HTML that will be displayed in the cell of the grid.

#4 web-johnny


    grocery CRUD Author

  • Administrators
  • 1,166 posts

Posted 14 October 2017 - 02:51 AM

I think @cletourneau idea is great actually  :D


Please guys have in mind that because we had some issues with callbackColumn, I would suggest to use the latest version of GCE (version 2.3.6)


Also @wildfandango have in mind that you can always change the limiter value from the config file to another number. More specifically the config value is: column_character_limiter





#5 wildfandango



  • Members
  • PipPip
  • 24 posts

Posted 15 October 2017 - 01:39 PM

Hi, thx for the info, finally my solution is a callbackColumn.


I use version 2.3.4 enterprise edt. without problems:


the callback

        $crud->callbackColumn('notes', function ($value, $row) {
            return lineFEED(viewFIELD("notices",$row->id,"notes"));

the viewFIELD (helper function)


function viewFIELD($tab,$id,$cam,$key='id')
    $CI =& get_instance();
    $query = $CI->db->query('SELECT '.$cam.' FROM '.$tab.' where '.$key.' = '.$id.' LIMIT 1');
    $qrow = $query->row_array();
    $result = $qrow[$cam];

    return $result;

the lineFEED (helper function)


function lineFEED($txt)
    $crs = array(chr(12), chr(13));
    return str_replace($crs, "<br>", $txt);


Also tagged with one or more of these keywords: columns, text

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users