行样式
可以通过以下方式实现自定义行的样式:
- Row Style: 为行提供 CSS 样式。
- Row Class: 为行提供 CSS 类。
#
Row Style可以通过以下方式为网格中的行添加 CSS 样式:
#
rowStylerowStyle
应用于所有行。 值为键(样式名称)和值(样式值)的对象。
export interface GridOptions { ... // providing a CSS style for the rows. rowStyle?: JSXInternal.CSSProperties; ...}
#
getRowStylerowStyle
的回调版本,可用于分别为不同行设置不同样式。 函数应该返回一个 CSS 值的对象。
export interface GridOptions { ... // callback version of property rowStyle to set style for each row individually. // function should return an object of CSS values. getRowStyle?: (params: RowClassParams) => JSXInternal.CSSProperties; ...}
#
示例#
Row Class可以通过以下方式为网格中的行添加 CSS 类:
#
rowClass所有行的 CSS 类。 值为字符串数组(类名数组)。
export interface GridOptions { ... // CSS class(es) for all rows. provide an array of strings (array of class names). rowClass?: string[]; ...}
#
getRowClassrowClass
的回调版本,可用于分别为不同行设置不同类。 函数应返回字符串数组(类名数组)。
export interface GridOptions { ... // callback version of property rowClass to set class(es) for each row individually. // function should return an array of strings (array of class names). getRowClass?: (params: RowClassParams) => string[]; ...}