【发布时间】:2014-10-13 18:32:09
【问题描述】:
我有一个 SlickGrid,它的 dataview 工作得很好,grid 和 dataview 使用 syncGridSelection 同步以修改和删除选择,但是在更改 CSS 样式时会出现一个有趣的问题。当我选择一个不包含实际更改行的过滤器集时,更改的行 CSS 样式将应用于网格中相同的“可见”行号。排序工作正常,但我注意到过滤器不起作用。有没有人可以解决这个问题?您能否为我粘贴尽可能多的信息和代码,因为我是 SlickGrid 的新手。我粘贴了加载网格的代码。
function LoadGridData() {
$.getJSON('@Url.Action("GetConfigurations")', function (rows) {
if (rows.length > 0) {
if (rows[0].id = 'undefined') {
$(rows).each(function (index) {
rows[index].newAttribute = "id"
rows[index]["id"] = index;
});
}
};
data = rows;
dataView.beginUpdate();
dataView.setItems(data);
dataView.setFilter(filter);
dataView.endUpdate();
// Refresh the data render
grid.invalidate();
grid.render();
grid.setSelectedRows([]);
dataView.syncGridSelection(grid, true);
});
}
【问题讨论】:
标签: slickgrid