Select Specific Columns to Expand/Collapse Row in Mobile View
Select Specific Columns to Expand/Collapse Row in Mobile View
hashmaster3k
Posts: 6Questions: 2Answers: 0
in Responsive
Is there a way to allow only selected columns to show/hide the hidden columns for each row?
Example:
responsive: {
details: {
type: "column",
targets: [0,1, 2, 4]
}
}
Columns 0, 1, 2 and 4 when clicked, will show/hide the remaining columns for each row. All other columns will not do anything when clicked.
This question has an accepted answers - jump to answer
Answers
The
responsive.details.target
state that you can use a string as a jQuery selector. Haven't tried it but it sounds like you can apply a classname to the columns you want to use to show/hide the hidden columns.Also note note the option is
target
nottargets
.Kevin
Thanks for the response Kevin. Indeed it is target and not targets. I was hoping maybe something similar existed to allow for specific selection of columns.
I attempted to use unique class name with no luck. Continuing on the example above:
Try prefixing the classname with a period, like this:
Kevin
That did the trick. Thank you.