我正在参考这个问题
DC JS : How to highlight rows in an aggregated data table on click, similar to a row chart?
nasdaqTable.on('pretransition', function (table) {
table.selectAll('td.dc-table-column')
.on('click', /* ... */)
table.selectAll('tr.dc-table-row')
.classed('sel-rows', d => filterKeys.indexOf(d.key) !== -1)
});
但是,我遇到了一个例外
d3.js:754 Uncaught (in promise) Error: unknown type: pretransition
at d3.js:754
at Array.map (<anonymous>)
at parseTypenames (d3.js:751)
at Dispatch.on (d3.js:763)
at Object._table.on (datatable.js:116)
at stock.js:305
我确定预转换事件在dc.js中。我正在使用dc.js v3.0.5和d3v5。