最近在使用EXTJS4 的grid panel,使用多表头展现数据.
var grid = Ext.create('Ext.grid.Panel', {
store: store,
columns: [
{
header: '序号',
dataIndex: 'xuhao',
sortable : false,
width: 100
}
,
{
header: '名称',
dataIndex: 'Name',
sortable : false,
width: 100
}
,
{
header: '结果',
columns:[
{
header: '本月',
dataIndex: 'curMonth',
sortable : false,
width: 150
}
,
{
header: '本年',
dataIndex: 'curYear',
sortable : false,
width: 150
}]
}
,
{
header: '备注',
dataIndex: 'note',
sortable : false,
width: 150
}
]
});如何遍历grid.columns所有节点?
var grid = Ext.create('Ext.grid.Panel', {
store: store,
columns: [
{
header: '序号',
dataIndex: 'xuhao',
sortable : false,
width: 100
}
,
{
header: '名称',
dataIndex: 'Name',
sortable : false,
width: 100
}
,
{
header: '结果',
columns:[
{
header: '本月',
dataIndex: 'curMonth',
sortable : false,
width: 150
}
,
{
header: '本年',
dataIndex: 'curYear',
sortable : false,
width: 150
}]
}
,
{
header: '备注',
dataIndex: 'note',
sortable : false,
width: 150
}
]
});如何遍历grid.columns所有节点?
var clm=columns.columns;
var clm=columns.columns;谢了,但是clm是undefined
var clm=columns[2].columns;
var items=column.items.items;
Ext.each(items,function(item){
alert(item.text);
});