- 浏览: 87708 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
sfc235300:
假如我传的一个参数为name=李连杰后台request.get ...
jQuery Ajax 传中文参数出现乱码(传值,乱码)
EXT2.0 grid 统计 sum(转自#$%^&)
关键字: ext2.0 grid 统计 sum
请问ext grid 中如何实现在每页的结尾显示一个可以自己定义的sum行
eg:
1 10
2 54
3 20
sum 84
eg:
1 10
2 54
3 20
sum 84
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/*
* Ext JS Library 2.0.2
* Copyright(c) 2006-2008, Ext JS, LLC.
* licensing@extjs.com
*
* http://extjs.com/license
*/
Ext.onReady(function(){
Ext.QuickTips.init();
var xg = Ext.grid;
var reader = new Ext.data.JsonReader({
idProperty:'taskId',
fields: [
{name: 'projectId', type: 'int'},
{name: 'project', type: 'string'},
{name: 'taskId', type: 'int'},
{name: 'description', type: 'string'},
{name: 'estimate', type: 'float'},
{name: 'rate', type: 'float'},
{name: 'cost', type: 'float'},
{name: 'due', type: 'date', dateFormat:'m/d/Y'}
]
});
// define a custom summary function
Ext.grid.GroupSummary.Calculations['totalCost'] = function(v, record, field){
return v + (record.data.estimate * record.data.rate);
}
var summary = new Ext.grid.GroupSummary();
var grid = new xg.EditorGridPanel({
ds: new Ext.data.GroupingStore({
reader: reader,
data: xg.dummyData,
sortInfo:{field: 'due', direction: "ASC"},
groupField:'project'
}),
columns: [
{
id: 'description',
header: "Task",
width: 80,
sortable: true,
dataIndex: 'description',
summaryType: 'count',
hideable: false,
summaryRenderer: function(v, params, data){
return ((v === 0 || v > 1) ? '(' + v +' Tasks)' : '(1 Task)');
},
editor: new Ext.form.TextField({
allowBlank: false
})
},{
header: "Project",
width: 20,
sortable: true,
dataIndex: 'project'
},{
header: "Due Date",
width: 25,
sortable: true,
dataIndex: 'due',
summaryType:'max',
renderer: Ext.util.Format.dateRenderer('m/d/Y'),
editor: new Ext.form.DateField({
format: 'm/d/Y'
})
},{
header: "Estimate",
width: 20,
sortable: true,
dataIndex: 'estimate',
summaryType:'sum',/////看这里
renderer : function(v){
return v +' hours';
},
editor: new Ext.form.NumberField({
allowBlank: false,
allowNegative: false,
style: 'text-align:left'
})
},{
header: "Rate",
width: 20,
sortable: true,
renderer: Ext.util.Format.usMoney,
dataIndex: 'rate',
summaryType:'average',
editor: new Ext.form.NumberField({
allowBlank: false,
allowNegative: false,
style: 'text-align:left'
})
},{
id: 'cost',
header: "Cost",
width: 20,
sortable: false,
groupable: false,
renderer: function(v, params, record){
return Ext.util.Format.usMoney(record.data.estimate * record.data.rate);
},
dataIndex: 'cost',
summaryType:'totalCost',
summaryRenderer: Ext.util.Format.usMoney
}
],
view: new Ext.grid.GroupingView({
forceFit:true,
showGroupName: false,
enableNoGroups:false, // REQUIRED!
hideGroupedColumn: true
}),
plugins: summary,
frame:true,
width: 800,
height: 450,
clicksToEdit: 1,
collapsible: true,
animCollapse: false,
trackMouseOver: false,
//enableColumnMove: false,
title: 'Sponsored Projects',
iconCls: 'icon-grid',
renderTo: document.body
});
});
Ext.grid.dummyProjects = [
{projectId: 100, project: 'Ext Forms: Field Anchoring'},
{projectId: 101, project: 'Ext Grid: Single-level Grouping'},
{projectId: 102, project: 'Ext Grid: Summary Rows'}
];
Ext.grid.dummyData = [
{projectId: 100, project: 'Ext Forms: Field Anchoring', taskId: 112, description: 'Integrate 2.0 Forms with 2.0 Layouts', estimate: 6, rate: 150, due:'06/24/2007'},
{projectId: 100, project: 'Ext Forms: Field Anchoring', taskId: 113, description: 'Implement AnchorLayout', estimate: 4, rate: 150, due:'06/25/2007'},
{projectId: 100, project: 'Ext Forms: Field Anchoring', taskId: 114, description: 'Add support for multiple types of anchors', estimate: 4, rate: 150, due:'06/27/2007'},
{projectId: 100, project: 'Ext Forms: Field Anchoring', taskId: 115, description: 'Testing and debugging', estimate: 8, rate: 0, due:'06/29/2007'},
{projectId: 101, project: 'Ext Grid: Single-level Grouping', taskId: 101, description: 'Add required rendering "hooks" to GridView', estimate: 6, rate: 100, due:'07/01/2007'},
{projectId: 101, project: 'Ext Grid: Single-level Grouping', taskId: 102, description: 'Extend GridView and override rendering functions', estimate: 6, rate: 100, due:'07/03/2007'},
{projectId: 101, project: 'Ext Grid: Single-level Grouping', taskId: 103, description: 'Extend Store with grouping functionality', estimate: 4, rate: 100, due:'07/04/2007'},
{projectId: 101, project: 'Ext Grid: Single-level Grouping', taskId: 121, description: 'Default CSS Styling', estimate: 2, rate: 100, due:'07/05/2007'},
{projectId: 101, project: 'Ext Grid: Single-level Grouping', taskId: 104, description: 'Testing and debugging', estimate: 6, rate: 100, due:'07/06/2007'},
{projectId: 102, project: 'Ext Grid: Summary Rows', taskId: 105, description: 'Ext Grid plugin integration', estimate: 4, rate: 125, due:'07/01/2007'},
{projectId: 102, project: 'Ext Grid: Summary Rows', taskId: 106, description: 'Summary creation during rendering phase', estimate: 4, rate: 125, due:'07/02/2007'},
{projectId: 102, project: 'Ext Grid: Summary Rows', taskId: 107, description: 'Dynamic summary updates in editor grids', estimate: 6, rate: 125, due:'07/05/2007'},
{projectId: 102, project: 'Ext Grid: Summary Rows', taskId: 108, description: 'Remote summary integration', estimate: 4, rate: 125, due:'07/05/2007'},
{projectId: 102, project: 'Ext Grid: Summary Rows', taskId: 109, description: 'Summary renderers and calculators', estimate: 4, rate: 125, due:'07/06/2007'},
{projectId: 102, project: 'Ext Grid: Summary Rows', taskId: 110, description: 'Integrate summaries with GroupingView', estimate: 10, rate: 125, due:'07/11/2007'},
{projectId: 102, project: 'Ext Grid: Summary Rows', taskId: 111, description: 'Testing and debugging', estimate: 8, rate: 125, due:'07/15/2007'}
];
* Ext JS Library 2.0.2
* Copyright(c) 2006-2008, Ext JS, LLC.
* licensing@extjs.com
*
* http://extjs.com/license
*/
Ext.onReady(function(){
Ext.QuickTips.init();
var xg = Ext.grid;
var reader = new Ext.data.JsonReader({
idProperty:'taskId',
fields: [
{name: 'projectId', type: 'int'},
{name: 'project', type: 'string'},
{name: 'taskId', type: 'int'},
{name: 'description', type: 'string'},
{name: 'estimate', type: 'float'},
{name: 'rate', type: 'float'},
{name: 'cost', type: 'float'},
{name: 'due', type: 'date', dateFormat:'m/d/Y'}
]
});
// define a custom summary function
Ext.grid.GroupSummary.Calculations['totalCost'] = function(v, record, field){
return v + (record.data.estimate * record.data.rate);
}
var summary = new Ext.grid.GroupSummary();
var grid = new xg.EditorGridPanel({
ds: new Ext.data.GroupingStore({
reader: reader,
data: xg.dummyData,
sortInfo:{field: 'due', direction: "ASC"},
groupField:'project'
}),
columns: [
{
id: 'description',
header: "Task",
width: 80,
sortable: true,
dataIndex: 'description',
summaryType: 'count',
hideable: false,
summaryRenderer: function(v, params, data){
return ((v === 0 || v > 1) ? '(' + v +' Tasks)' : '(1 Task)');
},
editor: new Ext.form.TextField({
allowBlank: false
})
},{
header: "Project",
width: 20,
sortable: true,
dataIndex: 'project'
},{
header: "Due Date",
width: 25,
sortable: true,
dataIndex: 'due',
summaryType:'max',
renderer: Ext.util.Format.dateRenderer('m/d/Y'),
editor: new Ext.form.DateField({
format: 'm/d/Y'
})
},{
header: "Estimate",
width: 20,
sortable: true,
dataIndex: 'estimate',
summaryType:'sum',/////看这里
renderer : function(v){
return v +' hours';
},
editor: new Ext.form.NumberField({
allowBlank: false,
allowNegative: false,
style: 'text-align:left'
})
},{
header: "Rate",
width: 20,
sortable: true,
renderer: Ext.util.Format.usMoney,
dataIndex: 'rate',
summaryType:'average',
editor: new Ext.form.NumberField({
allowBlank: false,
allowNegative: false,
style: 'text-align:left'
})
},{
id: 'cost',
header: "Cost",
width: 20,
sortable: false,
groupable: false,
renderer: function(v, params, record){
return Ext.util.Format.usMoney(record.data.estimate * record.data.rate);
},
dataIndex: 'cost',
summaryType:'totalCost',
summaryRenderer: Ext.util.Format.usMoney
}
],
view: new Ext.grid.GroupingView({
forceFit:true,
showGroupName: false,
enableNoGroups:false, // REQUIRED!
hideGroupedColumn: true
}),
plugins: summary,
frame:true,
width: 800,
height: 450,
clicksToEdit: 1,
collapsible: true,
animCollapse: false,
trackMouseOver: false,
//enableColumnMove: false,
title: 'Sponsored Projects',
iconCls: 'icon-grid',
renderTo: document.body
});
});
Ext.grid.dummyProjects = [
{projectId: 100, project: 'Ext Forms: Field Anchoring'},
{projectId: 101, project: 'Ext Grid: Single-level Grouping'},
{projectId: 102, project: 'Ext Grid: Summary Rows'}
];
Ext.grid.dummyData = [
{projectId: 100, project: 'Ext Forms: Field Anchoring', taskId: 112, description: 'Integrate 2.0 Forms with 2.0 Layouts', estimate: 6, rate: 150, due:'06/24/2007'},
{projectId: 100, project: 'Ext Forms: Field Anchoring', taskId: 113, description: 'Implement AnchorLayout', estimate: 4, rate: 150, due:'06/25/2007'},
{projectId: 100, project: 'Ext Forms: Field Anchoring', taskId: 114, description: 'Add support for multiple types of anchors', estimate: 4, rate: 150, due:'06/27/2007'},
{projectId: 100, project: 'Ext Forms: Field Anchoring', taskId: 115, description: 'Testing and debugging', estimate: 8, rate: 0, due:'06/29/2007'},
{projectId: 101, project: 'Ext Grid: Single-level Grouping', taskId: 101, description: 'Add required rendering "hooks" to GridView', estimate: 6, rate: 100, due:'07/01/2007'},
{projectId: 101, project: 'Ext Grid: Single-level Grouping', taskId: 102, description: 'Extend GridView and override rendering functions', estimate: 6, rate: 100, due:'07/03/2007'},
{projectId: 101, project: 'Ext Grid: Single-level Grouping', taskId: 103, description: 'Extend Store with grouping functionality', estimate: 4, rate: 100, due:'07/04/2007'},
{projectId: 101, project: 'Ext Grid: Single-level Grouping', taskId: 121, description: 'Default CSS Styling', estimate: 2, rate: 100, due:'07/05/2007'},
{projectId: 101, project: 'Ext Grid: Single-level Grouping', taskId: 104, description: 'Testing and debugging', estimate: 6, rate: 100, due:'07/06/2007'},
{projectId: 102, project: 'Ext Grid: Summary Rows', taskId: 105, description: 'Ext Grid plugin integration', estimate: 4, rate: 125, due:'07/01/2007'},
{projectId: 102, project: 'Ext Grid: Summary Rows', taskId: 106, description: 'Summary creation during rendering phase', estimate: 4, rate: 125, due:'07/02/2007'},
{projectId: 102, project: 'Ext Grid: Summary Rows', taskId: 107, description: 'Dynamic summary updates in editor grids', estimate: 6, rate: 125, due:'07/05/2007'},
{projectId: 102, project: 'Ext Grid: Summary Rows', taskId: 108, description: 'Remote summary integration', estimate: 4, rate: 125, due:'07/05/2007'},
{projectId: 102, project: 'Ext Grid: Summary Rows', taskId: 109, description: 'Summary renderers and calculators', estimate: 4, rate: 125, due:'07/06/2007'},
{projectId: 102, project: 'Ext Grid: Summary Rows', taskId: 110, description: 'Integrate summaries with GroupingView', estimate: 10, rate: 125, due:'07/11/2007'},
{projectId: 102, project: 'Ext Grid: Summary Rows', taskId: 111, description: 'Testing and debugging', estimate: 8, rate: 125, due:'07/15/2007'}
];
发表评论
-
Ext grid中在条件下显示或不显示某些列
2011-08-12 14:52 1185//#region当合同资金类型为付款时,列表显示开户银行和账 ... -
ExtJs中的ComboBox详细说明
2011-08-08 16:53 2941Ext.form.ComboBox属性及常用方法详解 2010 ... -
从grid中一次删除多条数据
2011-08-05 15:53 1050/** * 删除自定义字段 */ ... -
遍历grid下某一个字段的总和
2011-08-03 15:08 1385{ layout : 'fit', ... -
从Grid 获得 JSON 数据
2011-08-02 11:19 1174/** * 从Grid 获得 JSON 数据 ... -
隐藏显示tabpanel中的items
2011-07-28 11:28 1283xtype : 'tabpanel', ... -
最小长度与最大长度验证
2011-07-21 12:25 1368//取值范围(选择数字时显示) ... -
Ext.自动适应宽度
2011-07-19 12:04 985var setting_customfieldslist_g ... -
Ext.Tree扩展CheckBox方法
2011-07-15 12:16 1032/////引入这个JS: Ext.ux.tree.Tre ... -
Extjs 列表中牢定不显示fixed
2011-07-15 11:03 926header :"所属项目" ... -
Ext核心API详解-Ext.tree.TreePanel
2011-07-08 17:16 1731Ext核心API详解-Ext.tree ... -
Form 和 Grid之间切换,列表和增删改
2011-07-08 15:56 853//Store contractAction.contrac ... -
Ext中封装的几个function
2011-07-06 10:07 718/** * 拼一个请求地址 ... -
JS中的try catch
2011-07-04 16:09 1267try{ //要调试的JS代码段 ... -
Ext智能提示 - Spket(Visual Studio 2008 插件)
2011-07-04 09:16 1048Visual Studio 2008的Ext 2.0 ... -
Ext2.0 form使用实例
2011-06-23 11:55 762Ext2.0 的 form 不单增加了时间输入控件、隐藏 ... -
新建的时候给文本框附值(自己记录的备忘)
2011-06-21 10:28 780前台JS: //#region获取供 ... -
[转载]Ext.data-GroupingStore/JsonStore/SimpleStore
2011-06-10 09:48 1007[转载]Ext.data-GroupingStore/ ... -
Ext同步与异步请求(转自garnettcwm)
2011-06-01 15:43 1185EXTJS 同步和异步请求 ... -
Ext一些方法的重写
2011-05-25 12:12 882重写了Ext2.2的一些方法,比如tableform等
相关推荐
EXT2.0 GRID 示例是一个基于EXT JavaScript库的高级数据展示和操作组件的实例。EXT是一个强大的前端开发框架,尤其在创建交互式Web应用程序方面表现出色。EXT2.0是EXT库的一个早期版本,它提供了丰富的用户界面组件...
ext2.0笔记ext2.0笔记ext2.0笔记ext2.0笔记ext2.0笔记ext2.0笔记ext2.0笔记ext2.0笔记ext2.0笔记ext2.0笔记ext2.0笔记ext2.0笔记ext2.0笔记ext2.0笔记ext2.0笔记ext2.0笔记ext2.0笔记ext2.0笔记ext2.0笔记ext2.0笔记...
5. **图表组件**:EXT2.0引入了图表组件,可以轻松创建各种统计图表,如柱状图、饼图、线图等,为数据可视化提供了有力工具。 6. **可扩展性**:EXT2.0的API设计得更为完善,更容易进行二次开发和扩展,允许开发者...
ext-2.0ext-2.0ext-2.0ext-2.0ext-2.0ext-2.0ext-2.0ext-2.0ext-2.0ext-2.0ext-2.0ext-2.0ext-2.0ext-2.0ext-2.0ext-2.0ext-2.0ext-2.0ext-2.0ext-2.0ext-2.0ext-2.0ext-2.0ext-2.0
EXT 2.0是Sencha公司推出的一个基于JavaScript的开源用户界面库,专门用于构建富互联网应用程序(RIA)。它提供了一套完整的组件化、可定制的UI控件,包括树形视图、菜单、弹出式菜单等,使得开发者能够轻松创建具有...
3. **EXT2.0中文教程.exe**: 这可能是一个以可执行文件(.exe)形式的中文教学程序,对于中文用户来说非常友好。它可能包含了视频教程、交互式示例或者图文并茂的讲解,帮助学习者更直观地理解Ext 2.0的用法和功能。...
Ext 2.0是Sencha公司开发的一个JavaScript库,主要用于构建富互联网应用程序(RIA)。这个中文文档包含了关于Ext 2.0的详细说明,对于开发者来说是一个非常宝贵的资源,可以帮助他们理解和使用这个强大的前端框架。 ...
**EXT2.0官方文档详解** EXT2,全称Extended File System 2,是Linux操作系统中广泛使用的一种文件系统。这个文件系统在1993年由Rebecca Ann Heineman和Stephen Tweedie开发,作为EXT1的升级版,旨在解决EXT1在大...
EXT2.0是一款基于JavaScript的富客户端开发框架,它提供了丰富的组件库和强大的数据管理功能,使得在浏览器端构建复杂的用户界面变得简单。本插件是EXT2.0针对本地浏览API的扩展,旨在增强EXT应用程序对本地资源的...
在Ext JS 2.0中,Grid组件提供了丰富的交互性和定制性,如排序、过滤、编辑等功能。 分页机制的实现主要涉及两个部分:前端Grid组件和后端PHP服务。前端负责展示数据和处理用户交互,后端则负责数据的获取和分页...
本文档主要针对EXT2.0版本进行介绍。 EXT2.0在EXT1.x的基础上进行了大量的改进和优化,增加了更多的UI组件,提升了性能,并且强化了对Ajax和数据绑定的支持。Ajax技术允许Web应用在不刷新整个页面的情况下与服务器...
Ext2.0包含了一系列的UI组件,如面板(Panel)、表格(Grid)、表单(Form)、菜单(Menu)、按钮(Button)、工具栏(Toolbar)、树形视图(Tree)等。这些组件都具有高度可配置性和可扩展性,能够满足各种复杂的...
EXT2.0是一种广泛应用于Linux操作系统中的文件系统,它的全称是Extended File System Version 2.0。在Linux世界中,文件系统是管理和组织磁盘数据的核心组件,它决定了文件如何存储、检索以及如何实现高效的读写操作...
### Ext2.0框架的Grid使用介绍 #### 一、Ext2.0框架概述 Ext2.0是一款基于JavaScript的库,它提供了大量的用户界面组件,使得开发人员能够轻松地构建出高度交互式的Web应用程序。相比其他框架如YUI等,Ext2.0拥有...
EXT2.0 API详解 EXT2(Second Extended File System)是Linux操作系统中广泛使用的文件系统之一,它在1992年由Rene Rebeau设计并实现,为Linux社区提供了可靠且高效的文件存储解决方案。随着技术的发展,EXT2也经历...
1. **组件化设计**:EXT2.0引入了一套完整的组件系统,如表格(Grid)、面板(Panel)、窗口(Window)和菜单(Menu),这些组件可以自由组合,形成复杂的用户界面。 2. **数据绑定**:EXT2.0实现了模型-视图-控制...
1. **组件系统**:EXT 2.0拥有一个强大的组件模型,包括窗口(Window)、表格(Grid)、面板(Panel)、按钮(Button)等。这些组件可以方便地组合和嵌套,实现复杂界面布局。 2. **数据绑定**:EXT 2.0支持数据...
EXT 2.0是EXT库的一个早期版本,它包含了一系列用于构建用户界面的组件和工具,如表格、面板、菜单、窗口等。EXT 2.0项目源代码的分享为开发者提供了一个深入了解EXT框架内部工作原理和最佳实践的机会。 在EXT 2.0...
Ext 2.0是一个强大的JavaScript库,专门用于构建富客户端应用程序。它是一个基于Ajax技术的开发框架,Ajax(Asynchronous JavaScript and XML)的核心理念是通过后台与服务器进行异步数据交换,无需刷新整个页面,...
1. **组件系统**:EXT2.0拥有强大的组件体系,包括窗口(Window)、面板(Panel)、表格(Grid)、表单(Form)、树形控件(Tree)等。每个组件都有其特定的属性、配置选项、事件和方法,这些在API文档中都有详细的...