Show hidden column in child row (using responsive)

Show hidden column in child row (using responsive)

glimpsed_chaosglimpsed_chaos Posts: 138Questions: 29Answers: 4

Link to test case: https://live.datatables.net/quxobeji/5/edit?html,js,output
Error messages shown: None
Description of problem:

I cannot figure out how to show the "long text column" in the child row and hide the "truncated text column" in the child row.

The linked test case has a truncated text column and a full text column without truncation. The full text column is hidden because it runs too long in some cases.

I am using responsive but have also tried setting up childrows without responsive. Preference of course is to use responsive.

Appreciate assistance on this.

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,188Questions: 26Answers: 4,925
    Answer ✓

    One option is to use a customer renderer like this example.

    I updated your test case a bit to make it simpler. It took a bit of timem ti figure out what to look at. I removed all but one row. The HTML table already had truncated data so I added some text so its greater than 100 characters. I copied the code from the example and updated the cell data output to get the original row data using row().data() if it's column 6 it displays the cell from column 8 otherwise just display the cell as is.
    https://live.datatables.net/yuhazaxa/1/edit

    Here is the same example using an ellipsis render.
    https://live.datatables.net/pesidaqe/1/edit

    Kevin

Sign In or Register to comment.