⚠ 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

Multiple lines in a text column



wildfandango

wildfandango
  • profile picture
  • Member

Posted 11 October 2017 - 15: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 ... :(

 


larasmith

larasmith
  • profile picture
  • Member

Posted 12 October 2017 - 00: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?


cletourneau

cletourneau
  • profile picture
  • Member

Posted 12 October 2017 - 14: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.


web-johnny

web-johnny
  • profile picture
  • Administrator
  • 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

Regards

Johnny

 

 


wildfandango

wildfandango
  • profile picture
  • Member

Posted 15 October 2017 - 13: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);
}