how to filter data in dcjs/crossfilter on selection of datatable row?

泪湿孤枕 提交于 2019-12-08 10:42:12

问题


I have seen most of the examples of dc.js which filters the data using brushes. How should i filter the data using the row element selected from datatable??

I am not sure of exact solution but some workaround may be done as

dimension.filter(value) 

where value updated onclick? Am I going in right direction or is there a better way?

Edit 1 If i draw a row chart of the same thing with the then I don't have to handle onlcick event or anything but for datatable why is it comparatively so much complecated?


回答1:


That should work. You will have to trigger the redraw events to the charts know about the change.




回答2:


yes I put a onclick="function(value)" button.

and

window.function(value){
    table.dimension(dimension);
    table.filter(value);
    table.render();
} 

PS: I am not proficient in dc.js so this method might not be a optimal solution



来源:https://stackoverflow.com/questions/19384104/how-to-filter-data-in-dcjs-crossfilter-on-selection-of-datatable-row

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!