开发者

SlickGrid cell styling lost on Sort

开发者 https://www.devze.com 2023-03-13 10:11 出处:网络
When sorting the rows in SlickGrid, it seems that they are all destroyed and recreated, thus losing the CSS classes that may have been added at run-time.

When sorting the rows in SlickGrid, it seems that they are all destroyed and recreated, thus losing the CSS classes that may have been added at run-time.

For example, I want rows that are "dirty" (that is, have been edited but not yet saved)((I don't auto-commit, but use a Save button on the grid to persist data)) to display diff开发者_开发知识库erently, specifically displaying a "dirty" icon.

So, when a row is "dirty", one of its cells (an icon column) gains a CSS class to display the proper icon. This however is then lost when rows are sorted. Is there a way to avoid the creation of brand new rows on a sort? Or a different method to accomplish this task?

Thanks!


SlickGrid explicitly forbids direct manipulation of the DOM elements it creates with the exception of editors. If you need to decorate a cell/row with a CSS class, do so using the APIs provided by SlickGrid (custom formatters, row/cell metadata, addCellCssStyles, etc.). That way, they will persist across re-renders.

0

精彩评论

暂无评论...
验证码 换一张
取 消