如何用extjs 3.4做三层表头
来源:互联网 发布:mysql导入xls文件 编辑:程序博客网 时间:2024/06/05 07:19
Ext.onReady(function() {
var continentGroupRow= [
{header: 'China', colspan: 1, align: 'center'},
{header: 'Japan', colspan: 1, align: 'center'},
{header: 'Ameria', colspan: 1,align: 'center'},
{header: 'Franch', colspan: 4, align: 'center'},
{header: 'Korea', colspan: 1,align: 'center'},
{header: 'Germany', colspan: 1, align: 'center'}
];
var cityGroupRow = [
{},
{},
{},
{header: 'beijing', colspan: 1, align: 'center'},
{header: 'hunan', colspan: 3, align: 'center'},
{},
{}
];
var group = newExt.ux.grid.ColumnHeaderGroup({
rows:[continentGroupRow, cityGroupRow]
});
var fields =
[
{type: 'int', name: 'BeijingProductX'},
{type: 'int', name: 'BeijingProductY'},
{type: 'int', name: 'TokyoProductX'},
{type: 'int', name: 'TokyoProductY'},
{type: 'int', name: 'BerlinProductX'},
{type: 'int', name: 'BerlinProductY'},
{type: 'int', name: 'LondonProductX'},
{type: 'int', name: 'LondonProductY'},
{type: 'int', name: 'ParisProductX'}
]
var columns=
[
{dataIndex: 'BeijingProductX', header: ''},
{dataIndex: 'BeijingProductY', header: ''},
{dataIndex: 'TokyoProductX', header: ''},
{dataIndex: 'TokyoProductY', header: ''},
{dataIndex: 'BerlinProductX', header: 'shangcha'},
{dataIndex: 'BerlinProductY', header: 'yueyang'},
{dataIndex: 'LondonProductX', header: 'hengyang'},
{dataIndex: 'LondonProductY', header: ''},
{dataIndex: 'ParisProductX', header: ''}
]
var grid = newExt.grid.GridPanel({
renderTo: 'column-group-grid',
title:'Sales By Location',
width:1000,
height:400,
store:new Ext.data.ArrayStore({
fields: fields
}),
columns: columns,
viewConfig: {
forceFit: true
},
plugins: group
});
});
这是在extjs的实例(..\examples\grid\ColumnHeaderGroup.js)基础上进行修改的,我在实现过程中遇到无法跨行的问题,后来发现是html文件中引用的样式导致的,把html里的<link rel="stylesheet" type="text/css" href="../ux/css/ColumnHeaderGroup.css" />去掉就OK了,如果没有效果可以看一下引用的其他css文件里的样式是否包含: background: url(../../../resources/images/default/grid/grid3-hrow.gif) repeat-x bottom;,如果包含了就去掉。
去掉样式之后的效果:
- 如何用extjs 3.4做三层表头
- 如何用FLASH做网页背景
- 如何用电脑做服务器
- 如何用面包机做面包
- 如何用ppt做自我介绍
- 如何用虚拟机做服务器
- 如何用Java做网站?
- 【VBA研究】如何用split函数设置表头
- 如何用Visual C#做组件
- 如何用Visual C#做组件
- 如何用JAVA做IE插件?
- 如何用Visual C#来做组件
- 如何用MYSQL 做 Pivot Table?
- 如何用NextInstaller做web安装盘
- 如何用NextInstaller做数据库安装盘
- 如何用Visual C#做组件
- 如何用Visual C#做组件
- 转:如何用Visual C#做组件
- Android中的Handler机制
- 【华为机试】北京题2015.10.14
- 阶乘和
- HBase模式设计
- iOS每日一记——————一个很好的第三方库JVFloatLabeledTextField
- 如何用extjs 3.4做三层表头
- 17.1.4.4 Binary Log Options and Variables Binary Log
- 理解javascript面向对象编程
- 女生找对象与正则表达式(通配符)
- 用atomic一定是线程安全的吗?
- CEF C++环境搭建
- 浅谈android嵌入第三方sdk的二次封装原则
- C++ 接口(抽象类)
- Android Ant 自动打包带第三方库遇到的一些小问题