- 浏览: 470913 次
- 性别:
- 来自: 广州
-
文章分类
最新评论
-
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 2880/** * @class Ext.ux.b ... -
ExtJS 4.x 定制你的js
2011-05-01 00:04 0... -
ExtJS4.x 随笔(2011-04-29更新)
2011-04-29 13:41 39281.某个激活/禁用的checkboxfield,需要提交后台的 ... -
ExtJS 4.0 改善Ext.grid.plugin.RowEditing (重构,v1.4版本,2011-09-11)
2011-04-27 15:24 12846Ext4.0 自带的Ext.ux.RowEditing还不够完 ... -
ExtJS Tree刷新后自动展开并选择节点
2010-07-29 10:48 17831很久没写EXTJS的tip了... 今天帮组员写了一个 ... -
仅供纪念,曾做过的一些界面截图
2010-07-06 16:55 3628仅供记录用. 1.亚运(EXTJS) ... -
ExtJS3.x 随笔(2010-07-08更新)
2010-07-02 17:15 3697谨用该贴来记录一些使 ... -
Ext JS 3.2.0发布 -- 不少令人振奋的特性(更新翻译后的release-notes)
2010-04-01 15:02 3828不少令人振奋的新功能 1.form里面的复合组件 ---写 ... -
ExtJS EditorGridPanel中时间日期编辑问题的总结
2009-09-23 09:48 10357老是被反复问到这个问题,烦了...总结下... 1.首 ... -
Ext 3.0.1 Release Notes
2009-08-31 07:58 3987难熬的三天....JE终于恢复了.... 可惜要付费 ... -
也谈谈Ext.Grid之记录用户使用习惯—隐藏列
2009-08-27 15:58 7645在论坛看到http://www.iteye ... -
ExtJS 常见问题 - by tz
2009-08-14 16:13 0经常在群里面被问到的一些问题,不如汇集起来算了... ... -
ExtJS 3.0 优秀扩展简介 (持续更新)
2009-08-14 10:14 17426自带示例里面的扩展就 ... -
ExtJS 2.3/3.0 定制你所需要的模块
2009-08-12 13:49 13338很实在的一个需求,就是 ... -
ExtJS Combo 下拉列表正常显示HTML标签内容
2009-08-11 15:02 5949解决问题: http://www.iteye.com/pro ... -
ExtJS 3.0 Designer Preview (官方的IDE可视化工具)
2009-08-11 12:35 24738原文地址: http://extjs.com/blog/200 ... -
ExtJS Menu嵌套combo等控件时,自动隐藏/遮盖等bug的解决方案
2009-08-06 12:41 63002010-07-08补充: DateField隐藏的 ... -
ExtJS 输入框/MessageBox.prompt 禁止粘贴
2009-07-30 13:33 6832回答问题http://www.iteye.com/proble ... -
ExtJS 修复3.0里面的LovCombo(下拉多选框)的Bug
2009-07-27 16:16 11414如果你不知道lovcombo是什么,看http://setti ... -
续:ExtJS Chart 扩展(重构了下,并写了个新的示例--内存监控)
2009-07-27 15:55 6017续前文:http://atian25.iteye.com/bl ...
相关推荐
// 要设置的列,此处是设置第一列 var colModel = _gridPanel.colModel; // 得到所有列 if (data.data.items[0] == null) { // 如果没数据,设置一个默认宽度 colModel.setColumnWidth(columnIndex, multple * ...
### ExtJS 下 Grid 的一些属性说明 #### 一、界面修改(cssstyle) 在使用ExtJS构建应用程序时,可能会发现默认的界面风格与自己的产品风格不一致。为了更好地适配现有设计,可以通过修改CSS来定制网格(grid)的...
-修正了Grid列属性DataFormatString的一个bug,比如设置{0:yy-MM-dd HH:mm}时没有效果。 -修正下拉列表控件不能绑定DataTable的BUG(feedback:RedOcean)。 -增加土耳其语言资料文件(feedback:abdullaharslan)。 -...
+修正动态创建Grid列的BUG(feedback:gxpan)。 -增加示例(data/grid_dynamic_columns.aspx)。 -修正Form不能自适应浏览器大小的改变(feedback:kaywood)(WorkItem#6309)。 -增加重载方法Alert.Show(message, ...
34. UniGUI 使用报表 Grid+Report 的方法之一 (静态调用 ) ................................................ 28 35. UniGUI 使用报表 Grid+Report 的方法之二 (动态调用 ) .........................................