admin管理员组文章数量:1426655
I am using datatables and wanted to represent hierarchical JSON data in a grid. I got the data to display hierarchically in the datatable through ajax, but I am having trouble with javascript implementing the expanding and collapsing of the rows.
Please take a look at this JSBin and try expanding and collapsing and you will see the issue:
The behavior should be like any hierarchical data (like the windows explorer):
- When the grid loads, it should display first level rows with the expand icon.
- When the top level expand button is clicked, it should open second level rows for the same parent with an expand button (if there are 3rd level rows).
- When the second level expand button is clicked, it should open the third level rows.
Please take a look and suggest any JS changes. Please feel free to modify the fiddle.
Thanks.
I am using datatables and wanted to represent hierarchical JSON data in a grid. I got the data to display hierarchically in the datatable through ajax, but I am having trouble with javascript implementing the expanding and collapsing of the rows.
Please take a look at this JSBin and try expanding and collapsing and you will see the issue:
http://live.datatables/qedufunu/1/edit
The behavior should be like any hierarchical data (like the windows explorer):
- When the grid loads, it should display first level rows with the expand icon.
- When the top level expand button is clicked, it should open second level rows for the same parent with an expand button (if there are 3rd level rows).
- When the second level expand button is clicked, it should open the third level rows.
Please take a look and suggest any JS changes. Please feel free to modify the fiddle.
Thanks.
Share Improve this question asked Nov 19, 2014 at 17:06 JakeJake 26.1k31 gold badges114 silver badges178 bronze badges1 Answer
Reset to default 3Okay. I fixed it myself. For folks who need a solution for nested rows in datatable, this should help immensely.
http://live.datatables/qedufunu/2/edit
本文标签: javascriptDatatablesTrouble with expanding and collapsing nested rowsStack Overflow
版权声明:本文标题:javascript - Datatables - Trouble with expanding and collapsing nested rows - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745449738a2658829.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论