[英]Datatables - Trouble with expanding and collapsing nested rows
I am using datatables and wanted to represent hierarchical JSON data in a grid. 我正在使用数据表,并希望在网格中表示分层JSON数据。 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.
我通过ajax将数据分层显示在数据表中,但是我在使用javascript实现扩展和折叠行时遇到了麻烦。
Please take a look at this JSBin and try expanding and collapsing and you will see the issue: 请看一下这个JSBin并尝试扩展和折叠,你会看到这个问题:
http://live.datatables.net/qedufunu/1/edit http://live.datatables.net/qedufunu/1/edit
The behavior should be like any hierarchical data (like the windows explorer): 行为应该像任何分层数据(如Windows资源管理器):
Please take a look and suggest any JS changes. 请查看并建议任何JS更改。 Please feel free to modify the fiddle.
请随意修改小提琴。
Thanks. 谢谢。
Okay. 好的。 I fixed it myself.
我自己修好了。 For folks who need a solution for nested rows in datatable, this should help immensely.
对于需要在数据表中嵌套行的解决方案的人来说,这应该会有很大帮助。
http://live.datatables.net/qedufunu/2/edit http://live.datatables.net/qedufunu/2/edit
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.