1. 首先添加一个dataview组件,设置配置项baseCls(注意是baseCls而不是cls)
xtype:'dataview',
itemId:'dataViewId',
baseCls:'exam-dataview' //exam-dataview样式
2. 在样式文件中添加偶数行背景色的代码,因为默认的是白色
.exam-dataview-item:nth-child(even){
background-color:#e6e6e6;
}
baseCls:The base CSS class to apply to this component's element. This will also be prepended to other elements within this component. To add specific styling for sub-classes, use the cls config.
cls:The CSS class to add to this component's element, in addition to the baseCls