- 浏览: 462557 次
- 性别:
- 来自: 广州
文章分类
最新评论
-
njliukang:
请问一下,如果是异步树,应该怎么解决?貌似用expandpat ...
ExtJS Tree刷新后自动展开并选择节点 -
xiaoyueyue5721:
这是ScriptDataSet,如果换成OdaDataSet呢 ...
Birt动态填充DataSet数据 -
leexiaodong2009:
我准备要用那个锁定。
ExtJS 3.0 优秀扩展简介 (持续更新) -
babyhhcsy:
pizza823 写道分享下另外中方法store里面不用变在列 ...
ExtJS EditorGridPanel中时间日期编辑问题的总结 -
冷月宫主:
高手,请问一下有没有使用Ext做过多表头锁定左侧指定列的处理? ...
仅供纪念,曾做过的一些界面截图
首先是cell内容自动换行,在官方FAQ那提到是加一句CSS:
.x-grid3-cell-inner { /*内容长的时候换行*/ white-space:normal !important; }
其次,Grid的某几列都指定了宽度,就剩下一列(如图中的"内容")是让它自适应的.
var cm = new Ext.grid.ColumnModel([ sm, { header:'名称', dataIndex:'alarmName', //renderer:this.simpleRenderer, width:40, sortable:true },{ header:'对象', dataIndex:'node', renderer:function(value,meta,record){ var nodeType = Ext.util.Format.uppercase(record.get('nodeType')); if(['BSC','MSC','MGW','GGSN','SGSN'].indexOf(nodeType)!=-1){ meta.css = 'netcell'; meta.attr = String.format(' netcell="{0}" netcellType="{1}" ',record.get('node'),nodeType); } return value; }, tooltip:'鼠标悬浮可查看相关网元', css:"text-align:center;", width:20, sortable:true },{ header:'内容', dataIndex:'alarmContent', //renderer:this.simpleRenderer, sortable:true },{ header:'最早发生时间', dataIndex:'firstTime', type:'date', renderer:Ext.util.Format.dateRenderer('y-m-d H:i:s'), css:"text-align:center;", width:30, sortable:true },{ header:'最后发生时间', dataIndex:'createTime', type:'date', renderer:Ext.util.Format.dateRenderer('y-m-d H:i:s'), css:"text-align:center;", width:30, sortable:true },{ header:'次数', dataIndex:'stackTimes', //renderer:this.simpleRenderer, css:"text-align:center", width:12, sortable:true },{ header:'操作', dataIndex:'node', renderer:function(value,meta,record){ var resultStr = "<div class='controlBtn'><a href='javascript:void(0);' class='alarm_detail'>详细</a> | <a href='javascript:void(0);' class='alarm_check'>签阅</a> | <a href='javascript:void(0);' class='alarm_delete'>删除</a></div>"; return resultStr; }, css:"text-align:center;", width:30, sortable:false } ]);
var grid = new Ext.grid.GridPanel({ //title:'::网元告警&关注事件(近24小时)::', region:'center', store:store, enableColumnMove: true, enableHdMenu: true, autoScroll: true, cm:cm, sm:sm, columnLines:true, trackMouseOver:false, //minColumnWidth:11, //loadMask:'载入中...', viewConfig:{ forceFit: true, deferEmptyText: true, emptyText: "<div>业务运行正常</div>", enableRowBody:true, getRowClass: function(record, rowIndex, rowParams, store){ if(record.get('alarmType')==Elvis.NetCellAlarmMonitor.ALARM_TYPE_CALLLIMIT_EVENT){ return 'alarm_row_event'; }else{ return 'alarm_row_alarm'; } } } });
在IE一切正常,在FF3下,最右边的操作老溢出。如下图
换了autoExpandColumn感觉不管用.
官方论坛上问了,回复说是forceFit:true后,column里面设置的无效.
今天看了下GridView的源码, fitColumns() 里面有一句cm.setColumnWidth(i, Math.max(this.grid.minColumnWidth, Math.floor(w + w*frac)), true);
于是试了下在grid里面加一句minColumnWidth:11,结果发现OK了...
先记录下,回头再细看一下这个函数吧...呵呵...
评论
3 楼
atian25
2009-08-31
damoqiongqiu 写道
你总是走在最前面的那个人,呵呵。这个问题也困扰我许久
实际上是我理解错误了.
forceFit后各个cm的width是算总和的百分比的
2 楼
damoqiongqiu
2009-08-31
你总是走在最前面的那个人,呵呵。这个问题也困扰我许久
1 楼
atian25
2009-06-29
Column width : Number The initial width in pixels of the column. The width of each column can also be affected if any of the following are configured: 1.Ext.grid.GridPanel.autoExpandColumn 2.Ext.grid.GridView.forceFit By specifying forceFit:true, non-fixed width columns will be re-proportioned (based on the relative initial widths) to fill the width of the grid so that no horizontal scrollbar is shown. 3.Ext.grid.GridView.autoFill 4.Ext.grid.GridPanel.minColumnWidth Note: when the width of each column is determined, a space on the right side is reserved for the vertical scrollbar. The Ext.grid.GridView.scrollOffset can be modified to reduce or eliminate the reserved offset.
还是有问题,forceFit后各个cm的width是算总和的百分比的
发表评论
-
[4.x] Ext.ux.button.AutoRefresher
2011-05-23 11:22 2667/** * @class Ext.ux.b ... -
ExtJS 4.x 定制你的js
2011-05-01 00:04 0... -
ExtJS4.x 随笔(2011-04-29更新)
2011-04-29 13:41 36971.某个激活/禁用的checkboxfield,需要提交后台的 ... -
ExtJS 4.0 改善Ext.grid.plugin.RowEditing (重构,v1.4版本,2011-09-11)
2011-04-27 15:24 12530Ext4.0 自带的Ext.ux.RowEditing还不够完 ... -
ExtJS Tree刷新后自动展开并选择节点
2010-07-29 10:48 17620很久没写EXTJS的tip了... 今天帮组员写了一个 ... -
仅供纪念,曾做过的一些界面截图
2010-07-06 16:55 3373仅供记录用. 1.亚运(EXTJS) ... -
ExtJS3.x 随笔(2010-07-08更新)
2010-07-02 17:15 3519谨用该贴来记录一些使 ... -
Ext JS 3.2.0发布 -- 不少令人振奋的特性(更新翻译后的release-notes)
2010-04-01 15:02 3730不少令人振奋的新功能 1.form里面的复合组件 ---写 ... -
ExtJS EditorGridPanel中时间日期编辑问题的总结
2009-09-23 09:48 10141老是被反复问到这个问题,烦了...总结下... 1.首 ... -
Ext 3.0.1 Release Notes
2009-08-31 07:58 3920难熬的三天....JE终于恢复了.... 可惜要付费 ... -
也谈谈Ext.Grid之记录用户使用习惯—隐藏列
2009-08-27 15:58 7549在论坛看到http://www.iteye ... -
ExtJS 常见问题 - by tz
2009-08-14 16:13 0经常在群里面被问到的一些问题,不如汇集起来算了... ... -
ExtJS 3.0 优秀扩展简介 (持续更新)
2009-08-14 10:14 17183自带示例里面的扩展就 ... -
ExtJS 2.3/3.0 定制你所需要的模块
2009-08-12 13:49 13221很实在的一个需求,就是 ... -
ExtJS Combo 下拉列表正常显示HTML标签内容
2009-08-11 15:02 5862解决问题: http://www.iteye.com/pro ... -
ExtJS 3.0 Designer Preview (官方的IDE可视化工具)
2009-08-11 12:35 24634原文地址: http://extjs.com/blog/200 ... -
ExtJS Menu嵌套combo等控件时,自动隐藏/遮盖等bug的解决方案
2009-08-06 12:41 61362010-07-08补充: DateField隐藏的 ... -
ExtJS 输入框/MessageBox.prompt 禁止粘贴
2009-07-30 13:33 6734回答问题http://www.iteye.com/proble ... -
ExtJS 修复3.0里面的LovCombo(下拉多选框)的Bug
2009-07-27 16:16 11288如果你不知道lovcombo是什么,看http://setti ... -
续:ExtJS Chart 扩展(重构了下,并写了个新的示例--内存监控)
2009-07-27 15:55 5896续前文:http://atian25.iteye.com/bl ...
相关推荐
该文档里面的代码能够完美解决extjs的桌面图标换行问题,我亲自试用过
Extjs 中想改变grid 行高,如果只是简单的设置了height的值是可以实现grid 的行高,但是如果使用了插件:rowexpander ,最出现新的问题。 感兴趣的朋友可以试试的。 此文档可以解决你的烦恼,为了找到资源下载,...
extjs4.0 实现桌面图标换行,具体改动参考 4.0.2a\examples\desktop\App.js 核心方法参考这句 //这里初始化所有图标 this.initShortcut(); 我觉得我说的很清楚了,还不明白的留言,一点js不懂的请闪开,谢谢
ExtJS grid过滤操作,可以动态操作本地的store更改筛选的内容
extjs grid示例代码extjs grid示例代码extjs grid示例代码extjs grid示例代码
ExtJs Grid是否选择行,是:返回选择行record;否:返回false
EXTJS grid导出EXCEL文件,源码可以直接导入MYECLIPSE使用,EXTJS版本3.2.0
Extjs动态Grid的生成 htm
extjs grid 多表头 插件 extjs grid 多表头 插件
这是利用sencha cmd 生成的GridFilterDemo工程中的app和build文件夹,其余文件过大并且与主题无关,因此未包含。具体方法,请参看我的博客: 《Extjs4.2 Grid Filter Feature 表格过滤特性》
extjs grid ide:myeclipse5.5 jboss4.2.1 extjs4.2.1
ExtJs 4.0 Grid 单元格合并控件封装
很多同事在用extjs grid做分页的时候,往往会想用grid的多选功能来实现导出Excel之类的功能(也就是所谓的多选记忆功能),但在选选择下一页的时候 上一页选中的已经清除 这是因为做分页的时候又向服务器请求了分页...
自己写的一个Extjs Grid2Grid拖拽
这是一个简单的在extjs下的grid转化到Excel,里面代码简单易懂,在包里面还集成了复杂的js转化函数,不过本人没有用它来进行转化! 注:在用EXTJS的导出Excel技术中,一定要注意分页的问题
Ext grid 动态添加字段、列扩展, 如何动态添加或者删除一个grid的列
ExtJs grid多选时获取选中的所有值,以及其他相关的操作
EXTJS Grid布局总结例子,含源代码。
ExtJS 表格的功能实现,包括单元格编辑,数据的获取。
EXTJS4 GRID 表格 分页 编辑 添加判断 颜色判断 分组 等示例