- 浏览: 69225 次
- 性别:
- 来自: 北京
最近访客 更多访客>>
最新评论
-
hzfeibao:
总结的很详细啊
Ext.grid.GridPanel -
lixiaodong59421:
Ext菜单可以显示到非ext控件上吗?
Ext.menu.Menu -
lixiaodong59421:
asdfasdfasdf
Ext.menu.Menu -
guanzhongdaoke54007:
有没有详细的,比如例子?
Ext.form.Radio -
deng1259070:
我要列加背景色怎么做?
Ext.grid.GridPanel
1、Ext.grid.GroupingView
主要配置项:
enableGroupingMenu:是否在表头菜单中进行分组控制,默认为true
groupByText:表头菜单中分组控制的菜单文字,默认为'Group By This Field'
enableNoGroups:是否允许用户关闭分组功能,默认为true
showGroupsText:在表头菜单中启用分组和禁用分组的菜单文字,默认为'Show in Groups'
groupTextTpl:用于渲染分组信息的模板,默认为'{text}',常用的可选值有:
text:列标题:组字段值
gvalue:组字段的值
startRow:组行索引
enableGrouping:是否对数据分组,默认为true
hideGroupedColumn:是否隐藏分组列,默认为false
ignoreAdd:在向表格中添加数据时是否刷新表格,默认为false
showGroupName:是否在分组行上显示分组字段的名字,默认为true
startCollapsed:初次显示时分组是否处于收缩状态,默认为false
主要方法:
collapseAllGroups():收缩所有分组行
expandAllGroups():展开所有分组行
getGroupId( String value ):根据分组字段值取得组id
toggleAllGroups( [Boolean expanded] ):切换所有分组行的展开或收缩状态
toggleGroup( String groupId, [Boolean expanded] ):切换指定分组行的展开或收缩状态
2、Ext.data.GroupingStore
groupField:分组字段
groupOnSort:是否在分组字段上排序,默认为false
remoteGroup:是否远程分组数据,默认为false。如果是远程分组数据,则通过groupBy参数发送分组字段名
3、范例源码
var datas = [[1,"张三",24,"男",new Date(1986,06,09)], [2,"李四",30,"女",new Date(1980,09,13)], [3,"王五",28,"男",new Date(1982,01,10)]];
var person = Ext.data.Record.create([
{name: "personId", mapping: 0},
{name: "personName", mapping: 1},
{name: "personAge", mapping: 2},
{name: "personGender", mapping: 3},
{name: "personBirth", mapping: 4}
]);
var grid = new Ext.grid.GridPanel({
title: "GroupingView实例",
renderTo: "div1",
width: 500,
height: 300,
frame: true,
tbar: [
{
text: "展开/收缩",
iconCls: "search",
handler: function(){
var view = grid.getView();
//var groupId = view.getGroupId("男");
//view.toggleGroup(groupId);
view.toggleAllGroups();
}
}
],
store: new Ext.data.GroupingStore({
reader: new Ext.data.ArrayReader({id:0}, person),
data: datas,
sortInfo: {field:"personId", direction:"ASC"}, //数据排序
groupField: "personGender" //分组字段
}),
view: new Ext.grid.GroupingView({
sortAscText: "升序",
sortDescText: "降序",
columnsText: "表格字段",
groupByText: "使用当前字段进行分组",
showGroupsText: "表格分组",
groupTextTpl: "{text}(共{[values.rs.length]}条)"
}),
columns: [
{id:"personId", header:"编号", width:50, dataIndex:"personId"},
{id:"personName", header:"姓名", width:70, dataIndex:"personName"},
{id:"personAge", header:"年龄", width:45, dataIndex:"personAge"},
{id:"personGender", header:"性别", width:45, dataIndex:"personGender"},
{id:"personBirth", header:"出生日期", width:120, dataIndex:"personBirth", renderer:Ext.util.Format.dateRenderer("Y年m月d日")}
]
});
主要配置项:
enableGroupingMenu:是否在表头菜单中进行分组控制,默认为true
groupByText:表头菜单中分组控制的菜单文字,默认为'Group By This Field'
enableNoGroups:是否允许用户关闭分组功能,默认为true
showGroupsText:在表头菜单中启用分组和禁用分组的菜单文字,默认为'Show in Groups'
groupTextTpl:用于渲染分组信息的模板,默认为'{text}',常用的可选值有:
text:列标题:组字段值
gvalue:组字段的值
startRow:组行索引
enableGrouping:是否对数据分组,默认为true
hideGroupedColumn:是否隐藏分组列,默认为false
ignoreAdd:在向表格中添加数据时是否刷新表格,默认为false
showGroupName:是否在分组行上显示分组字段的名字,默认为true
startCollapsed:初次显示时分组是否处于收缩状态,默认为false
主要方法:
collapseAllGroups():收缩所有分组行
expandAllGroups():展开所有分组行
getGroupId( String value ):根据分组字段值取得组id
toggleAllGroups( [Boolean expanded] ):切换所有分组行的展开或收缩状态
toggleGroup( String groupId, [Boolean expanded] ):切换指定分组行的展开或收缩状态
2、Ext.data.GroupingStore
groupField:分组字段
groupOnSort:是否在分组字段上排序,默认为false
remoteGroup:是否远程分组数据,默认为false。如果是远程分组数据,则通过groupBy参数发送分组字段名
3、范例源码
var datas = [[1,"张三",24,"男",new Date(1986,06,09)], [2,"李四",30,"女",new Date(1980,09,13)], [3,"王五",28,"男",new Date(1982,01,10)]];
var person = Ext.data.Record.create([
{name: "personId", mapping: 0},
{name: "personName", mapping: 1},
{name: "personAge", mapping: 2},
{name: "personGender", mapping: 3},
{name: "personBirth", mapping: 4}
]);
var grid = new Ext.grid.GridPanel({
title: "GroupingView实例",
renderTo: "div1",
width: 500,
height: 300,
frame: true,
tbar: [
{
text: "展开/收缩",
iconCls: "search",
handler: function(){
var view = grid.getView();
//var groupId = view.getGroupId("男");
//view.toggleGroup(groupId);
view.toggleAllGroups();
}
}
],
store: new Ext.data.GroupingStore({
reader: new Ext.data.ArrayReader({id:0}, person),
data: datas,
sortInfo: {field:"personId", direction:"ASC"}, //数据排序
groupField: "personGender" //分组字段
}),
view: new Ext.grid.GroupingView({
sortAscText: "升序",
sortDescText: "降序",
columnsText: "表格字段",
groupByText: "使用当前字段进行分组",
showGroupsText: "表格分组",
groupTextTpl: "{text}(共{[values.rs.length]}条)"
}),
columns: [
{id:"personId", header:"编号", width:50, dataIndex:"personId"},
{id:"personName", header:"姓名", width:70, dataIndex:"personName"},
{id:"personAge", header:"年龄", width:45, dataIndex:"personAge"},
{id:"personGender", header:"性别", width:45, dataIndex:"personGender"},
{id:"personBirth", header:"出生日期", width:120, dataIndex:"personBirth", renderer:Ext.util.Format.dateRenderer("Y年m月d日")}
]
});
发表评论
-
ext GridPanel 分页
2010-10-26 10:26 1261<!DOCTYPE html PUBLIC " ... -
EXT各种组件
2010-10-10 16:55 1007本范例展示如何使用表单的各种组件。 下拉框组件展示了5种使用 ... -
Ext.form.TimeField
2010-10-10 16:54 201113、Ext.form.TimeField 配置项 ... -
Ext.form.FieldSet
2010-10-10 16:46 136412、Ext.form.FieldSet 配置项: ... -
Ext.form.DateField
2010-10-10 16:45 121911、Ext.form.DateField 配置项: ... -
Ext.form.ComboBox
2010-10-10 16:45 176810、Ext.form.ComboBox 配置项: ... -
Ext.form.RadioGroup
2010-10-10 16:44 9819、Ext.form.RadioGroup 配置项: ... -
Ext.form.Radio
2010-10-10 16:44 8798、Ext.form.Radio 方法: ... -
Ext.form.CheckboxGroup
2010-10-10 16:44 9417、Ext.form.CheckboxGroup 配 ... -
Ext.form.Checkbox
2010-10-10 16:43 8036、Ext.form.Checkbox 配置项: ... -
Ext.form.NumberField
2010-10-10 16:43 10945、Ext.form.NumberField 配置 ... -
Ext.form.TextArea
2010-10-10 16:43 12874、Ext.form.TextArea 配置项: ... -
Ext.form.TextField
2010-10-10 16:43 12233、Ext.form.TextField 配置项: ... -
Ext.form.Label
2010-10-10 16:42 11042、Ext.form.Label 配置项: ... -
Ext.form.Hidden
2010-10-10 16:42 8111、Ext.form.Hidden -
Ext.form.Field
2010-10-10 16:41 10844、Ext.form.Field 配置项: ... -
Ext.form.FormPanel
2010-10-10 16:41 8553、Ext.form.FormPanel 配置项 ... -
Ext.form.BasicForm
2010-10-10 16:41 11232、Ext.form.BasicForm 配置项: ... -
Ext.form.Action
2010-10-10 16:41 10871、Ext.form.Action 配置项: ... -
Ext.grid.PropertyGrid
2010-10-10 16:40 15661、Ext.grid.PropertyGrid 主 ...
相关推荐
NULL 博文链接:https://atian25.iteye.com/blog/1019910
Ext.grid.GridPanel属性祥解, 表格部门的详解,通俗易懂,适合初学人员,以及想对GridPanel有个精析认识的Web开发人员
EXT.JS_文档EXT.JS_文档EXT.JS_文档EXT.JS_文档EXT.JS_文档EXT.JS_文档EXT.JS_文档EXT.JS_文档EXT.JS_文档EXT.JS_文档EXT.JS_文档EXT.JS_文档EXT.JS_文档EXT.JS_文档EXT.JS_文档EXT.JS_文档EXT.JS_文档EXT.JS_文档...
Ext.grid.ColumnModel显示不正常
封装Ext.grid.Grid+dwr实现增删该查
1. Ext.form.NumberField 2. Ext.form.TextArea 3. Ext.form.TriggerField 4. Ext.form.DateField 5. Ext.form.ComboBox 6. Ext.form.TimeField
71、Ext.grid.GridView类 …………… 59 72、Ext.grid.GroupingView类 ………… 60 73、Ext.grid.EditorGridPanel类 ……… 62 74、Ext.grid.PropertyGrid类 …………… 65 1、Ext类 addBehaviors(Object ...
Ext.grid.GridPanel 删除线 放到example文件夹下运行
2、Ext.ux.grid.feature.Tileview 3、Ext.ux.upload.Button 4、Ext.ux.toggleslide.ToggleSlide 5、Ext.ux.container.ButtonSegment 6、Ext.ux.grid.plugin.RowEditing 7、Ext.ux.grid.plugin.DragSelector 8、Ext....
org.restlet.ext.spring.jar
主要介绍了Ext4.2的Ext.grid.plugin.RowExpander无法触发事件解决办法,本文中的事件指collapsebody和expandbody事件,需要的朋友可以参考下
Ext.3.0.中文Ext.3.0.中文Ext.3.0.中文Ext.3.0.中文Ext.3.0.中文Ext.3.0.中文Ext.3.0.中文Ext.3.0.中文
1、Ext类 ………………………………… 2 2...71、Ext.grid.GridView类 …………… 59 72、Ext.grid.GroupingView类 ………… 60 73、Ext.grid.EditorGridPanel类 ……… 62 74、Ext.grid.PropertyGrid类 …………… 65
extjs多选下拉框,Ext.ux.form.LovCombo,extjs 以修复多选下拉框火狐下取不到值的问题,火狐下div不显示背景色的问题
运行Microsoft office时,vbe6ext.olb不能加载
此文档是可编辑表格Ext.grid.EditorGridPanel的说明以及示例的源代码,放到eclipse里面即可运行,显示出效果!
环境:Window XP Sp2、Tomcat 6.0、...关于Ext.data.Store类,我们可以看出:该框架提供了客户端缓存的功能--这对于我们框架系统是非常有帮助的。本示例代码注释非常详细。 阅读对象:需要使用Ext框架进行Web开发的人员
Ext.data.Store的基本用法 Ext.data.Store的基本用法 Ext.data.Store的基本用法