如何在SlickGrid中将类添加到单元格 [英] How to add a class to a cell in SlickGrid
问题描述
有人知道如何在SlickGrid中将"myClass"类添加到某个单元格中(例如第5行,第3列)吗?
要将特定的CSS类添加到某些行中,请使用最近在 http://github.com/mleibman/SlickGrid/commit/26d525a136e74e0fd36f6d45f0d53d1ce2df40ed
您不能将CSS类添加到特定单元格,而只能添加到给定列中的所有单元格-请使用列定义上的"cssClass"属性. 也许您可以将两者结合使用.
另一种方法是使用自定义格式器将内部DIV放入单元格中,然后在其中设置类.由于您可以访问格式化程序中的行/单元格,因此可以决定如何呈现它. Does anyone has an idea how could I add "myClass" class to some cell (for example, row 5, column 3) in a SlickGrid ? To add a specific CSS class to some of the rows, use the "rowClasses" option added recently in http://github.com/mleibman/SlickGrid/commit/26d525a136e74e0fd36f6d45f0d53d1ce2df40ed You cannot add a CSS class to a specific cell, only to all cells in a given column - use the "cssClass" property on the column definition. Perhaps you can use a combination of those two.
Another way is to put an inner DIV inside a cell using a custom formatter and set the class there. Since you have access to row/cell within the formatter, you can decide how to render it. 这篇关于如何在SlickGrid中将类添加到单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!