【发布时间】:2016-01-05 17:49:06
【问题描述】:
所以我正在使用 PivotTable.js,这对工作很有帮助。
不过现在,我正在尝试获取一个过滤器来根据值更改单元格的颜色或单元格内的字体。
例如,如果我的数据集中有一组日期
dates = ["N/A", "4/12/2016", "7/9/2024", "7/9/2024", "4/1/2013"]
我想在 2016 年 6 月 1 日之前的任何日期更改颜色。
如果这有什么不同,我会将我的数据作为变量“数据”在本地传递
$(function(){
var derivers = $.pivotUtilities.derivers;
var renderes = $.extend($.pivoUtilities.renderers, $.pivotUtilities.export_renderers);
$("#pivot_table").pivotUI(data, {
derivedAttributes: function(data){
// not sure how to access the css of the element from here
}
rows: [],
cols: ["Name", "Date", "Organization", "Cost"],
renderers: renderers,
rendererName: "Table"
});
});
我尝试过进入derivedAttributes,但我尝试的一切都不起作用。
任何帮助或头脑风暴将不胜感激
【问题讨论】:
标签: javascript css colors conditional-formatting pivottable.js