row.child.isShown() returns opposite of what API states (I think)

row.child.isShown() returns opposite of what API states (I think)

dlanz38dlanz38 Posts: 17Questions: 4Answers: 0

I'm was trying to hide/show child rows according to this example: https://datatables.net/examples/api/row_details.html

But I think row.child.isShown() returns the opposite of what the API states. It returns true when the child row is hidden and false when it is shown.
https://datatables.net/reference/api/row().child.isShown()

Am I just reading this wrong?

Here is an example:
http://live.datatables.net/cehufuse/14/edit

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 20,142Questions: 26Answers: 4,736
    Answer ✓

    You are using the Responsive extension to show and hide the child rows. You aren't using the row().child() APIs for this. I suspect that responsive is showing the row before your event executes the console.log(row.child.isShown()); statement. If you want to use child rows instead of responsive then you will want to follow the example you linked to and use the row().child() API to build your child row display.

    Kevin

  • dlanz38dlanz38 Posts: 17Questions: 4Answers: 0

    Ah, didn't realize there was a difference between the two. I figured there was something I was missing. Thanks for the clarification

This discussion has been closed.