Jump to content


Multiple lines in a text column

columns text

  • Please log in to reply
4 replies to this topic

#1 wildfandango

wildfandango

    Member

  • 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

larasmith

    Advanced Member

  • Members
  • PipPipPip
  • 193 posts
  • LocationPhilippines

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

cletourneau

    Member

  • Members
  • PipPip
  • 15 posts
  • LocationMontreal

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

web-johnny

    grocery CRUD Author

  • Administrators
  • 1,101 posts
  • LocationLondon

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

 

 


Posted Image

#5 wildfandango

wildfandango

    Member

  • 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