Ellipsis renderer that can expand column to show full text
Ellipsis renderer that can expand column to show full text
YoDavish
Posts: 123Questions: 46Answers: 3
Is there somthing similiar to ellipsis renderer for long text columns that if we click into the column that would expand the column to display the full text?
This question has an accepted answers - jump to answer
Answers
I don't believe anything exists to do this. However it looks like the ellipsis renderer could be updated to look at flag variable to decided whether to display the full data or the shortened data. Maybe something like this:
Then use an event handler, depending on what you want to click, to toggle the
ellipsisFlag
flag. Will need to callrows().invalidate()
anddraw()
in the event handler to have Datatables redraw the table. Something like this:https://live.datatables.net/secomafe/1/edit
Kevin
Just a quick note to say this example from this thread is similar, but you click on each record to expand the ellipses.
Colin
@kthorngren and @colin Thanks, I've gotten to work almost exactly how I want it. I put in an achor tag into the row that triggers the toggle. One last puzzle is how can it get to be only row specific, currently it will toggle all rows, this is the main function here:
Did you see Colin's example and thread he linked to? That should get you started.
Kevin
@kthorngren Yep, I figured it out and got it to work now, however, another issue pop up though. When I enabled server side. I no longer can toggle per row, it will toggle for all rows again.
nvm figured it out too. Thanks for you help!
We will need to see the problem to help debug. Please provide a link to your page or a test case replicating the issue so we can take a look. You can use one of the server side processing templates from here:
https://datatables.net/manual/tech-notes/9#Server-side-processing
Kevin