How to display only 20-30 first characters

QuestionsCategory: How TosHow to display only 20-30 first characters
Torin asked 3 years ago

Hi everyone!
How to display only 20-30 first characters from the textarea column in the grid.
I have no idea :/

greetings
Torin

6 Answers
Abu Ghufran Staff answered 3 years ago

You can check this demo: https://www.gridphp.com/demo/demos/integrations/readmore.php

Code: https://www.gridphp.com/demo/demos/integrations/readmore.phps

To check, put some long text by editing note column.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Torin answered 3 years ago

Thank you Abu!
It looks like that’s what I was looking for. I’m already working 🙂

greetings
Zbigniew

Francesco answered 3 months ago

Hello it doesn’ t work for me. It display full text ever:
Any suggest?

$col = array();
$col[“title”] = “Nome”;
$col[“name”] = “name”;
$col[“editoptions”] = array(“size”=>20);
$col[“width”] = “50”;
$col[“editable”] = false;
$col[“sortable”] = false;
$cols_items_gest[] = $col;

Abu Ghufran Staff answered 3 months ago

Please share your full code for review. You can attach code here and paste link in question.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Abu Ghufran Staff answered 3 months ago

I’m unable to get the issue from your code. I think you have not tried using readmore plugin in this code.

To use this plugin, follow these steps referring this code: https://www.gridphp.com/demo/demos/integrations/readmore.phps

  1. Refer line 104-105, add formatter and unformat property to the column you want readmore option
  2. Include readmore.min.js file as on line 126
  3. Use onload event line 33 and JS callback function as on 139-152
  4. Add css onpage, line 133-137 and 158-164

This will give you this result:

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

4 + 17 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?