简体   繁体   English

如何创建动态表 - Crossfilter - dc.js

[英]How can i create a dynamic Table - Crossfilter - dc.js

How can i create a dynamic Table like in the Airline on-time performance Example at the Crossfilter Homepage 我如何创建一个动态表,就像在Crossfilter主页上的航空公司准时性能示例一样

http://square.github.io/crossfilter/ http://square.github.io/crossfilter/

It's not full-featured but you can use the dc.js dataTable for this: 它不是功能齐全,但你可以使用dc.js dataTable:

https://github.com/dc-js/dc.js/blob/develop/web/docs/api-latest.md#dc.dataTable https://github.com/dc-js/dc.js/blob/develop/web/docs/api-latest.md#dc.dataTable

For fancier tables some people have had success integrating DataTables.js 对于更有趣的表,一些人已成功集成DataTables.js

https://github.com/dc-js/dc.js/issues/966 https://github.com/dc-js/dc.js/issues/966

I used this one. 我用过这个。 And it works :) 它的工作原理:)

 <div class="row">
        <table id='data-table'>
            <thead>
            <tr class='header'>
                <th>TestCase</th>
                <th>TestScript</th>
                <th>MonType</th>
            </tr>
            </thead>
        </table>
    </div>



dc.dataTable('#data-table')
        .dimension(TestCaseDim)
            .group(function (d) {
                return d.Timestamp.bold().fontcolor("darkblue");
            })
        .columns([
            function (d) { return d.TestCase; },
            function (d) { return d.TestScript; },
            function (d) { return d.MonitorType; }

        ])
        .size(500) 
        .order(d3.descending)
        .renderlet(function (table) {
            table.selectAll('.dc-table-group').classed('info', true);
        });

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM