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.
精彩评论