Open child rows on top of parent row
Open child rows on top of parent row
![haryp](https://secure.gravatar.com/avatar/b0daedfeacd4e2486e43ad8e6ce012cd/?default=https%3A%2F%2Fvanillicon.com%2Fb0daedfeacd4e2486e43ad8e6ce012cd_200.png&rating=g&size=120)
I need to implement functionality where child row will slide and open on the top of the parent row instead of bottom. Could anyone please help.
https://jsfiddle.net/nnb97rh9/3/
This discussion has been closed.
Answers
The jQuery insertBefore() method seems to do the trick:
https://jsfiddle.net/noszdw0c/
I made these changes:
The
row().child()
API allows has a class parameter. My example gets the row index and adds a classname that includes the row index. Each row ends up with a unique classname so we can use that as the selector forinsertBefore()
. This moves the child row before thetr
that is beingshown
.Also note I added the below to the example for the
slideDown()
method to work properly:There may be a better way to do this but it seems to work. I don't believe there are any built-in options for this.
Kevin
Thank you so much. I implemented this way.