如何在选择数据表行时在dcjs / crossfilter中过滤数据? [英] how to filter data in dcjs/crossfilter on selection of datatable row?
问题描述
我已经看到了dc.js的大多数示例,这些示例使用画笔过滤数据。我应该如何使用从数据表中选择的行元素来过滤数据?
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)
值在哪里更新onclick?我是朝着正确的方向走还是有更好的方法?
where value updated onclick? Am I going in right direction or is there a better way?
编辑1
如果我绘制相同的行图然后,我不必处理onlcick事件或其他任何事情,但对于数据表,为什么它是如此复杂?
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?
推荐答案
是的,我放了一个onclick = function(value)按钮。
yes I put a onclick="function(value)" button.
和
window.function(value){
table.dimension(dimension);
table.filter(value);
table.render();
}
PS:我不精通dc.js,因此此方法可能不是最佳解决方案
PS: I am not proficient in dc.js so this method might not be a optimal solution
这篇关于如何在选择数据表行时在dcjs / crossfilter中过滤数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!