1、控件尺寸通过主元素可以决定控件的尺寸和位置,这个遵循HTML/CSS规范。比如FlexGrid元素的class是”grid”,然后设置300pixcel的高度限制代码如下:.grid { height: auto; max-height: 300px;}
2、控件样式我们可以通过表格内的元素来设置样式。例如,使用grid类中的wj-cell元素就可以设置边框和白色背景。.grid .wj-cell { border: none; background-color: #fff;}
3、基于代码样式除了通过CSS设置样式,也可以通过代码来做。比如FlexGrid想要设置行高,可以使用如下的代码:// set the height of rows in the scrollable areaflex.rows.defaultSize = 34;// set the height of rows in the column header areaflex.columnHeaders.rows.defaultSize = 40;本文的示例就是基于如上的知识,对FlexGrid进行CSS样式设置。效果如下:
