Ext多表头
2013-03-14 11:30
211 查看
在ext3.2.1中的多表头设置
首先要将其中要用到的脚本与样式添加进来
ColumnHeaderGroup.js
ColumnHeaderGroup.css
GroupHeaderPlugin.js
GroupHeaderPlugin.css
然后在EXT中要进行多表头设置的grid中的CM进行如下更改:
var directionChangeCm = new Ext.grid.ColumnModel
({
columns:[
] ,
rows:[
[
{},{},{header:'合并8列',colspan:8, align:'center'},
{header:'合并8列',colspan:8, align:'center'},
{header:'合并7列',colspan:7, align:'center'},
{header:'合并两列',colspan:2, align:'center'},
{}
]
]
});
其中rows是设置合并的列,如果还要增加一个表头,可以再在rows中一条记录,
接着就是在grid属性中增加以下 的一些设置:
var directionChangeGrid = new Ext.grid.EditorGridPanel
({
cm: directionChangeCm,
doubleHead:true,//设置为true
rowSpan:true,//设置为true
sm: new Ext.grid.RowSelectionModel(),
autoScroll: true,
store: directionChangeStore,
clicksToEdit:1,//单击编辑
,plugins:[new Ext.ux.plugins.GroupHeaderGrid()]
});
EXT4.1.0以上的版本就比较简单(以下是ext自身的例子):
即是在columns中增加columns
首先要将其中要用到的脚本与样式添加进来
ColumnHeaderGroup.js
ColumnHeaderGroup.css
GroupHeaderPlugin.js
GroupHeaderPlugin.css
然后在EXT中要进行多表头设置的grid中的CM进行如下更改:
var directionChangeCm = new Ext.grid.ColumnModel
({
columns:[
] ,
rows:[
[
{},{},{header:'合并8列',colspan:8, align:'center'},
{header:'合并8列',colspan:8, align:'center'},
{header:'合并7列',colspan:7, align:'center'},
{header:'合并两列',colspan:2, align:'center'},
{}
]
]
});
其中rows是设置合并的列,如果还要增加一个表头,可以再在rows中一条记录,
接着就是在grid属性中增加以下 的一些设置:
var directionChangeGrid = new Ext.grid.EditorGridPanel
({
cm: directionChangeCm,
doubleHead:true,//设置为true
rowSpan:true,//设置为true
sm: new Ext.grid.RowSelectionModel(),
autoScroll: true,
store: directionChangeStore,
clicksToEdit:1,//单击编辑
,plugins:[new Ext.ux.plugins.GroupHeaderGrid()]
});
EXT4.1.0以上的版本就比较简单(以下是ext自身的例子):
var grid = Ext.create('Ext.grid.Panel', { store: store, columnLines: true, columns: [{ text : 'Company', flex : 1, sortable : false, dataIndex: 'company' }, { text: 'Stock Price', columns: [{ text : 'Price', width : 75, sortable : true, renderer : 'usMoney', dataIndex: 'price' }, { text : 'Change', width : 75, sortable : true, renderer : change, dataIndex: 'change' }, { text : '% Change', width : 75, sortable : true, renderer : pctChange, dataIndex: 'pctChange' }] },
{ text : 'Last Updated', width : 85, sortable : true, renderer : Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'lastChange' }], height: 350, width: 600, title: 'Grouped Header Grid', renderTo: 'grid-example', viewConfig: { stripeRows: true } });
即是在columns中增加columns
相关文章推荐
- Ext.grid.GridPanel隐藏表头,只显示表内容
- Ext、以及Coolite下实现表格锁定列和多行表头
- Ext多层表头
- EXT获取Grid表头信息
- Ext.Net动态加载多表头
- EXT复合表头谷歌浏览器Chrome错位解决办法
- EXT.NET多表头样式问题
- EXT.NET 通过NPOI运用EXCEL模板实现导出多表头GridPanel
- Ext GridPanel 表头合并
- Ext.Net多表头跨行跨列
- Ext.grid.Panel 表头隐藏
- Ext、以及Coolite下实现表格锁定列和多行表头
- Ext以及Coolite下实现表格锁定列和多行表头
- ExtJs2.0学习系列(2)--Ext.Panel
- USBView & How to get the Serial Number from a USB disk & qextserialport
- Ext官方资源
- AJAX 表格字段数据排序,点击表头每列排序
- [Ext.Net]GridPanel之存储过程分页Sql版本
- 单向带表头链表中找节点
- Ext.extend 用法以及代码解读