row().child.show()

row().child.show()

Hendrik_SHendrik_S Posts: 24Questions: 10Answers: 0

Maybe i found a bug or otherwise i don't understand it and maybe you can explain it.

It's about:

https://datatables.net/reference/api/row().child.show()

"This method can be used to make the child rows of a parent row visible at any time."

I made this fiddle to test it:

https://jsfiddle.net/MaartenB/dLyo2w1k/

Clicking on the plus sign icon works well, but i made a div:

Click here to expand the row...

I attached a Jquery on click function on it. It looks like the child.show() is not working? Is that a bug or am i using that function wrong and why?

Answers

  • Hendrik_SHendrik_S Posts: 24Questions: 10Answers: 0

    Meanwhile i was reading more about it, but i still don't understand it. Probably it has something to do with:

    https://datatables.net/reference/api/row().child()


    function row().child( data [, className ] )
    Description:
    Set the data to show in the child row(s). Note that calling this method will replace
    any child rows which are already attached to the parent row.


    Probably in my Fiddle DataTables is thinking that the data to show in the child row(s) is empty and that's why there is nothing to see.

    So probably it's working if i am using something like:

    this.child( render(), 'child').show();

    But then render() is not a function, so i don't know how i can get access to that function from that place / scope i am using it??

    But then it's still weird to me, because then you're actually replacing all the child rows (which are already attached to the parent row i think) with the same content. And child.show() has to do:

    "This method can be used to make the child rows of a parent row visible at any time."

    I am not changing the child rows and i am using the default ul/li tag list from DataTables. So i would expect that with "child.show()" the child rows become visible, but that's not the case.

  • Hendrik_SHendrik_S Posts: 24Questions: 10Answers: 0

    Anyone? ;)

This discussion has been closed.