datatable - 如何使用 jquery 过滤数据表并添加值
问题描述
我正在使用 Datatable,我试图在文本红色或白色值的最后一个 td 列上过滤值..
当我点击箭头的过滤器时,什么都没有发生(没有过滤器操作)..
你知道为什么吗?
$('#sst-table-all-contracts').DataTable
({
'createdRow': function (row, data) {
$(row).find("td:eq(1)").attr("id", data[6]);
if (data[7] == null )
{
$(row).find('td:last').css("background", "white");
$(row).find('td:last').text("white");
$(row).find('td:last').css("color", "white");
}
else {
$(row).find('td:last').css("background", "red");
$(row).find('td:last').text("red");
$(row).find('td:last').css("color", "red");
}
},
"aaData": contractsList,
"aoColumns": [ {}, {}]
});
解决方案
推荐阅读
- ruby-on-rails - 部署到 heroku 失败,因为 sqlite3 在 gems 中,即使它不是
- javascript - 使用图表js打印图表
- css - 在悬停时显示另一个元素 - css
- maven - Maven / Nexus:在构建目录中下载工件元数据
- airflow - 具有夏令时的气流调度
- python-3.x - WebDriverException:消息:浏览器似乎已经退出,然后我们可以使用 GeckoDriver Selenium 和 Python 连接错误
- android - 相机运行时权限崩溃
- webpack-4 - Webpack 4 Plugin: Add module and get result from loader
- java - 如何按名称实例化参数化类型类
- html - HTML CSS 打印页面删除顶部和底部的空格