数据表 - 使用嵌套的独立表向下钻取行 [英] Datatables - Drill down rows with nested independent table
问题描述
是否有人使用带有向下钻取行和嵌套独立表的数据表?类似于powerTable?
Is anyone using DataTables with drill down rows and nested independent table? Similar to powerTable?
您可以发布任何链接/示例吗?
Can you post any links/examples?
推荐答案
这是我的 JSFiddle(按运行"以显示图标),它实现了独立的嵌套 jQuery 数据表.在这种情况下,我只是复制原始表格的 html,并将其发布到详细信息行中,以免我创建新表格的麻烦.
Here's my JSFiddle(press "Run" for icons to show) which implements independent nested jQuery DataTables. In this case I just copy the html of the original Table, and post it into the Details row, to save me the hassle of making a new Table.
这是代码中唯一有趣的部分,它使 NestedTables 与简单的 DrillDown 不同:
Here's the only interesting part of the code really, that makes the NestedTables different from simple DrillDown:
else { /* Open this row */
this.src = "http://i.imgur.com/d4ICC.png";
// fnFormatDetails() pieces my Table together, instead you can
// use whatever code you like to create your nested Table html
oTable.fnOpen(nTr, fnFormatDetails(iTableCounter, TableHtml), 'details');
// ... and here I cast dataTable() on the newly created nestedTable
oInnerTable = $("#exampleTable_" + iTableCounter).dataTable({
"bJQueryUI": true,
"sPaginationType": "full_numbers"
});
iTableCounter = iTableCounter + 1;
}
请注意如何在每个表上独立过滤、排序等.
Notice how you can Filter, Sort, etc.. on each table independently.
这篇关于数据表 - 使用嵌套的独立表向下钻取行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!