- 多个列数据绑定组合在一列一起使用。
只需要在 dataField 用逗号形式分割 dataField: 'CountryID,ProvinceName'
示例:var columns = [
{ id: 'CountryID', caption: '国家', dataField: 'CountryID,ProvinceName', 110 }
] ;
2.多行的列标题分组组合显示
在数据格式上要改变一点,示例如下
1 var columns = [ 2 //一层开始 3 { 4 caption: '区域', 5 columns: [ 6 { id: 'CountryID', caption: '国家', dataField: 'CountryID,ProvinceName', 110 }, 7 { id: 'ProvinceName', caption: '省份', dataField: 'CountryDetails.ProvinceName', 120 } 8 ] 9 }, 10 //一层结束 11 //一层开始 12 { id: 'date', caption: '成立时间', dataField: 'OrderDate', format: 'mm/dd/yyyy', 150 }, 13 //一层结束 14 { id: 'population', caption: '人口', dataField: 'population', 80 } 15 ];
示例图
3. 列的定位问题 (正常情况,可以随意拖到列,改变其位置,但是固定区域只有一列时,该列是没法被移动)
增加 pinned: 'right'
var columns = [
{ id: 'CountryID', caption: '国家', dataField: 'CountryID,ProvinceName', 110 , pinned: 'right' }
]