Remove child row button if data is null
Remove child row button if data is null
kerblooy
Posts: 3Questions: 1Answers: 0
So basically, I'm using this:
https://datatables.net/examples/api/row_details.html
My table has a button that shows a child row and displays data.
However, not every row has data for a child row!
Is there a way I can not show a button if the data is null?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Yes - rather than using
columns.className
to just apply thedetails-control
class to all cells in that column, you could usecreatedRow
to selectively add it based on the row's data.Allan
Wow, thank you very much! It's hard to think that it was that easy!
I can see why you have 5k+ answers!
Thanks again
Wish I'd had the answer's thing from the start - only enabled it a few years back .
Good to hear its working for you now!
Allan