- 浏览: 210756 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
zlbdexiaohao:
怎么去掉默认的图标,folderClosedIcon=&quo ...
FLEX 构建完美的带有CheckBox三状态的Tree控件 -
zlbdexiaohao:
看不懂看不懂
FLEX 构建完美的带有CheckBox三状态的Tree控件 -
FYIHDG:
[list][*][list][*][*][list][*][ ...
ImageIO读jpg的时候出现exception:bandOffsets.length is wr -
被剥削的程序员:
你好我在引用你的comboxtree解决问题的时候,发现点击父 ...
ComboBoxTree -
527184687:
[flash=200,200][url][img][list] ...
ext treePanel 更换图标 总结
分页后可保存checkbox的选择状态。
/** * 封装的grid * 功能:分页后仍保持选中状态 * 约定:root为list, totalProperty为total, grid的第一列必须为id */ Ext.namespace('Ext.ux.grid'); Ext.ux.grid.MyGrid = Ext.extend(Ext.grid.GridPanel,{ /* * true to keep the records selected when you paging * @default(false) * @type: boolean */ keepSelectedOnPaging: false, /* * the array to store the record id * @type: array */ recordIds:new Array(), /* * set your id Column Name * @default : this.CM_JR_Record[0].dataIndex */ idColName:'', /* * set this.store.load url; * @type: string */ url: '', /* * show the rowNumber or not * @type: boolean * @default: true */ rowNumber : true, /* * set the grid sm,if checkBoxSelection=true,sm=CheckBoxSelectionModel * else sm=RowSelectionModel,default to true; * @type: boolean */ checkBox: true, /* * set the grid cm array; * set the JsonReader record; * * format: [{name:'',header:'',visiable:'',...another cm options},{}], * @name=dataIndex * @visiable: set this record to the cm(grid header) default(true) * @type: array (records) */ CM_JR_Record: null, /* * true to add a bottom paging bar * @defalut: true * @type: boolean */ pagingBar: true, /* * config paging bar if pagingBar set true * @type: object * @default: {pageSize: 20,store: this.store,displayInfo: true, * displayMsg: '当前记录数: {0} - {1} 总记录数: {2}', * emptyMsg: '<b>0</b> 条记录'} */ pagingConfig:{ pageSize: 15, store: this.store, displayInfo: true, displayMsg: "显示第 {0} 条到 {1} 条记录,一共 {2} 条", emptyMsg: '<b>0</b> 条记录', }, viewConfig:{ forceFit: true }, //private initComponent: function(){ if(this.CM_JR_Record){ this.init_SM_CM_DS(); } if(this.pagingBar){ this.init_PagingBar(); } if(this.keepSelectedOnPaging){ this.init_OnPaging(); } Ext.ux.grid.MyGrid.superclass.initComponent.call(this); }, /* * init the grid use the config options * @return: void * @params: none */ init_SM_CM_DS: function(){ var gCm = new Array(); var gRecord = new Array(); if(this.rowNumber){ gCm[gCm.length]=new Ext.grid.RowNumberer(); } if(this.checkBox){ var sm = new Ext.grid.CheckboxSelectionModel(); gCm[gCm.length] = sm; this.selModel = sm; } for(var i=0;i<this.CM_JR_Record.length;i++) { var g = this.CM_JR_Record[i]; if(g.visiable || g.visiable=='undefined' || g.visiable==null){ gCm[gCm.length] = g; } gRecord[gRecord.length]={ name: g.dataIndex, type: g.type || 'string' } } //create grid columnModel this.cm = new Ext.grid.ColumnModel(gCm); this.cm.defaultSortable = true; //create a jsonStore this.store = new Ext.data.Store({ proxy: new Ext.data.HttpProxy({ url: this.url, method: 'post' }), reader:new Ext.data.JsonReader({ totalProperty: 'total', root: 'list' }, Ext.data.Record.create(gRecord) ) }); this.pagingConfig.store = this.store; if(this.pagingBar){ this.store.load({params:{start:0,limit:this.pagingConfig.pageSize}}); }else{ this.store.load(); } }, /* * 创建并初始化paging bar */ init_PagingBar: function(){ var bbar = new Ext.PagingToolbar(this.pagingConfig); this.bbar = bbar; }, init_OnPaging: function(){ this.idColName = this.CM_JR_Record[0].dataIndex ;//默认第一列为ID列 this.selModel.on('rowdeselect',function(selMdl,rowIndex,rec ){ for(var i=0;i<this.recordIds.length;i++) { if(rec.data[this.idColName] == this.recordIds[i]){ this.recordIds.splice(i,1); return; } } },this); this.selModel.on('rowselect',function(selMdl,rowIndex,rec){ if(this.hasElement(this.recordIds)){ for(var i=0;i<this.recordIds.length;i++){ if(rec.data[this.idColName] == this.recordIds[i]){ return; } } } this.recordIds.unshift(rec.data[this.idColName]); },this); this.store.on('load',function(st,recs){ if(this.hasElement(this.recordIds)){ st.each(function(rec){ Ext.each(this.recordIds,function(item,index,allItems){ if(rec.data[this.idColName] == item){ this.selModel.selectRecords([rec],true); return false; } },this); },this); } },this); }, hasElement : function(recIds){ if(recIds.length > 0) return true; else return false; } } )<SPAN style="FONT-FAMILY: Arial,Verdana,Sans-Serif"> //**************************这是个demo</SPAN>***************** <SPAN style="FONT-FAMILY: Arial,Verdana,Sans-Serif"><PRE class=jscript name="code">var CM_JR_Record = [ { dataIndex:"id", visiable: false//不显示,反之为显示 },{ dataIndex:"accid", header:"发布人ID", visiable: true },{ header: '标题', width: 80, dataIndex: 'bt', visiable: true }, { header: '发布时间', width: 80, dataIndex: 'fbsj', visiable: true }, { header: '发布人员', width: 80, dataIndex: 'fbry', visiable: true }, { header: '审核', width: 80, dataIndex: 'sh', visiable: true }, { header: '审核人员', width: 80, dataIndex: 'shry', visiable: true }, { header: '审核时间', width: 80, dataIndex: 'shsj', visiable: true }, { header: '点击数', width: 80, dataIndex: 'snum', visiable: true }]; var myGrid = new Ext.ux.grid.MyGrid({ url : '/ecommerce/findAllBulletin.action', // the store load url (required) CM_JR_Record: CM_JR_Record, //.....(required) rowNumber:true, //true to add a Ext.grid.RowNumberer,defalut(true) checkBox:true, //true to add a Ext.grid.CheckBoxSelectionModel,default(true) pagingBar:true, //true to add a Ext.PagingToolBar,default(true) // pagingConfig:objcet, //config pagingToolBar if pagingBar is true keepSelectedOnPaging: true, //true to FireEvent when you paging to keep the state of record selected recordIds : new Array() , // store seleced ids when keepSelectedOnPaging is true idColName :'id', //the id column name width : 700, height: 600, renderTo: 'editor-grid', tbar: [{ id : 'Add', text : ' 新建 ', tooltip : '新建一个表单', iconCls : 'add', pageSize: 15, handler : function(){ ptb_bt1(); } },{ text: '删除所选', iconCls:'remove', tooltip : '删除所选数据', handler : function(){ //myGrid.recordIds是一个数组,里面存放选中的checkboxid if(myGrid.recordIds.length == 0){ Ext.MessageBox.alert('提示','请选择一条记录!'); }else{ // 弹出对话框警告 Ext.MessageBox.confirm('确认删除', '你真的要删除所选用户吗?', function(btn){ if(btn == 'yes') {// 选中了是按钮 // 调用 DWR, 执行结果成功时方删除所有数据 bulletinService.delBulletin(myGrid.recordIds.toString(), function() { // 更新界面, 来真正删除数据 Ext.Msg.alert("成功","用户数据删除成功!"); myGrid.recordIds = new Array(); myGrid.store.load({params:{start:0,limit:15}}); }); } } ); } } }] }); myGrid.render();</PRE> 下载地址如下<A>http://download.csdn.net/source/521174</A></SPAN>
发表评论
-
extjs grid设置某行字体颜色 行颜色
2010-05-19 21:42 1913.x-grid-record-red table{//字体 ... -
ext logon
2009-10-21 23:15 1106<html> <head> ... -
ext form 表单提交数据的方法小结
2009-10-21 22:13 1897EXT的form表单ajax提交(默认提交方式) fu ... -
封装Ext tree 扩展功能
2009-10-13 11:31 1052扩展的功能有: 1. 搜索过滤树节点(保留结构) 2. ... -
ext例子
2009-10-10 09:37 839http://www.myext.cn/ -
EXTjs 文件压缩
2009-09-24 21:08 1736之前曾使用过的办法有gzip(我记性不是很好,就是放在IIS中 ... -
解决Extjs文件太大的问题
2009-09-24 10:09 3566在使用Extjs过程中,ext-all.js文件太大,在网络环 ... -
ComboBoxTree
2009-07-25 22:34 3799参考别人的改的 Ext.namespace(" ... -
SearchField
2009-07-18 19:14 2543/* * Ext JS Library 2.1 * ... -
PagingToolbar PageSizePlugin
2009-07-18 14:10 2084/** * Page Size Plugin for ... -
PagingToolbar 扩展
2009-07-18 13:52 2252Ext.namespace('Ext.ux.PagingT ... -
ext 简易上传控件
2009-07-14 14:39 1752//*************************** ... -
extJs之下拉框联动
2009-07-14 14:37 1832// 第一个下拉框 var parentStore ... -
combtree
2009-07-14 14:34 1054var comboxWithTree = new Ext. ... -
ext treePanel 更换图标 总结
2009-07-14 14:33 70471.动态更换图标: 代码 node.on('click', ... -
EXT 一个panel与tree结合读数据库json格式的例子
2009-07-13 13:37 2877var Tree = Ext.tree; Ext.onR ... -
ext3.0 dwrproxy 兼容2.x dwrproxy用法
2009-07-12 21:02 2790经测试 可以用,并且做了修改可以兼容以前的代码格式 Ex ... -
spket Eclipse 安装
2009-07-11 12:40 2277spket最好用了,而且它还支持ext,安装起来很简单.... ... -
ext3.0 ext direct
2009-07-11 11:14 2961具体的工程步骤: 首先,我们来搭建WEB服务端的程序: 这时, ... -
ext+dwr DynamicGridPanel 封装 态创建ext grid
2009-07-06 16:55 3678封装一个动态grid 继承Ext.grid.GridPanel ...
相关推荐
扩展的GridPanel,让其分页后保持选择状态
针对Gridpanel多表头的扩展,适用于2.2的ext版本,3以上的没有测试过,有兴趣的可以自己研究研究。
源代码js文件 博文链接:https://javaExtjs.iteye.com/blog/200923
Ext GridPanel 中实现加链接操作 Ext GridPanel 中实现加链接操作 Ext GridPanel 中实现加链接操作
EXT实例GridPanel. 实现简单的。
gridpanel的使用,挺好的啊 gridpanel的使用,挺好的啊 gridpanel的使用,挺好的啊
Extnet GridPanel 增行 删行 弹出窗体 页面传值
改变gridpanel的行颜色,以及gridpanel 的表格变色
ExtJS的GridPanel导出excel文件,方便快捷易懂!
使用ext.net代码动态创建gridpanel后任意显示在各种窗口中
Ext.grid.GridPanel 删除线 放到example文件夹下运行
Ext.grid.GridPanel属性祥解, 表格部门的详解,通俗易懂,适合初学人员,以及想对GridPanel有个精析认识的Web开发人员
ExtJs GridPanel双击事件获得双击的行,双击行可以选中前面的checkbox,并获得行号
对于GridPanel中拖动选中行排序的实现,网上有不少ExtJs实现的例子,但是没有找到使用Ext.net实现的,正好最近有个需求要使用,干脆来写一个。 DEMO功能说明: 1、拖动GridPanel选中行到新位置排序。 2、在拖动结束...
一个关于GridPanel的使用例子 介绍了Proxy,JsonReader Store gridPanel等几个对象的简单使用
详细介绍GridPanel各项属性,ExtJS 普通表格:Ext.grid.GridPanel属性详解
本人自己写的Extjs入门教程,上面实现了treePanel和GridPanel的集成和交互。
将页面的GridPanel中的数据导出到Excel中 测试Ext:版本2.2.1 支持GridSummary,GroupSummary和GroupHeaderPlugin插件 使用方法: 1)把三个JS文件引入到页面中 2)调用例句: var data2Excel = new Ext.icss.Data2...