- 浏览: 82901 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
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 1117//#region当合同资金类型为付款时,列表显示开户银行和账 ... -
ExtJs中的ComboBox详细说明
2011-08-08 16:53 2887Ext.form.ComboBox属性及常用方法详解 2010 ... -
从grid中一次删除多条数据
2011-08-05 15:53 981/** * 删除自定义字段 */ ... -
遍历grid下某一个字段的总和
2011-08-03 15:08 1323{ layout : 'fit', ... -
从Grid 获得 JSON 数据
2011-08-02 11:19 1106/** * 从Grid 获得 JSON 数据 ... -
隐藏显示tabpanel中的items
2011-07-28 11:28 1217xtype : 'tabpanel', ... -
最小长度与最大长度验证
2011-07-21 12:25 1329//取值范围(选择数字时显示) ... -
Ext.自动适应宽度
2011-07-19 12:04 932var setting_customfieldslist_g ... -
Ext.Tree扩展CheckBox方法
2011-07-15 12:16 984/////引入这个JS: Ext.ux.tree.Tre ... -
Extjs 列表中牢定不显示fixed
2011-07-15 11:03 815header :"所属项目" ... -
Ext核心API详解-Ext.tree.TreePanel
2011-07-08 17:16 1695Ext核心API详解-Ext.tree ... -
Form 和 Grid之间切换,列表和增删改
2011-07-08 15:56 821//Store contractAction.contrac ... -
Ext中封装的几个function
2011-07-06 10:07 679/** * 拼一个请求地址 ... -
JS中的try catch
2011-07-04 16:09 1182try{ //要调试的JS代码段 ... -
Ext智能提示 - Spket(Visual Studio 2008 插件)
2011-07-04 09:16 993Visual Studio 2008的Ext 2.0 ... -
Ext2.0 form使用实例
2011-06-23 11:55 702Ext2.0 的 form 不单增加了时间输入控件、隐藏 ... -
新建的时候给文本框附值(自己记录的备忘)
2011-06-21 10:28 733前台JS: //#region获取供 ... -
[转载]Ext.data-GroupingStore/JsonStore/SimpleStore
2011-06-10 09:48 970[转载]Ext.data-GroupingStore/ ... -
Ext同步与异步请求(转自garnettcwm)
2011-06-01 15:43 1148EXTJS 同步和异步请求 ... -
Ext一些方法的重写
2011-05-25 12:12 803重写了Ext2.2的一些方法,比如tableform等
相关推荐
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笔记...
我的资源不需要积分 EXT2.0 GRID 示例 很实用
ext2.0 grid 分页实例(php)
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
Ext2.0 中文文档。
在网上搜索了一大篇,终于找到啦,不敢独享,现发出来,希望能帮到大家EXT2.0 中文API
Ext2.0实用简明教程.pdf
Ext 2.0 框架结构图 Ext.Component ,Ext.BoxComponent ,Ext.Button, Ext.Editor
EXT 详解 包括EXT手册 EXT API详解 EXT工程包 EXT demo 。 EXT 2.0 EXT核心API
ext2.0API,比网页版好的多了。
资源名称:Ext2.0学习入门资源截图: 资源太大,传百度网盘了,链接在附件中,有需要的同学自取。
EXT 2.0学习资料 关于EXT的基本入门学习的PDF
Ext2.0中文帮助文档,里面有很详细的中文说明.可以很方便大的查的Ext的资料
ext2.0 的一个小例子。基本上把ext 的功能都用到了 一个不错的东西
ext2.0官方文档(chm),Ext 2.0 简明教程,Ext2经典应用
EXT2.0在本地浏览API的插件
Ext2.0API文档,在自己电脑上就可以运行,不用上网看了。另外需要下载AdobeAIRInstaller.exe安装
EXT2.0 插件 Eclipse
无论你是Ext库的新手,抑或是想了解Ext的人,本篇文章的内容都适合你。本文将简单地介绍Ext的几个基本概念,和如何快速地做出一个动态的页面并运行起来,假设读者已具备了一些JavaScript经验和初级了解HTML Dom
Ext2.0组件,全组件和帮助手册,部分为中文帮助手册