`
andy_ghg
  • 浏览: 290618 次
  • 性别: Icon_minigender_1
  • 来自: 扬州
社区版块
存档分类
最新评论

ExtJS 4.0.2a ActionColumn的使用

阅读更多
ActionColumn是有问题的(不敢说是BUG),text属性不起作用、iconCls不知所云,但是非要使用怎么办?下面是我做的一个例子可以看看用变态的方法解决它:
			xtype : "actioncolumn",
			html:'<div class="x-column-header-inner" id="ext-gen1293" style="padding-top: 0px; height: auto; "><span class="x-column-header-text" id="ext-gen1295">帐号状态</span><div class="x-column-header-trigger" id="ext-gen1294"></div></div>',
			sortable : false,
			dataIndex : "enabled",
			items: [{
				icon:"js/extjs/resources/icons/ms.gif",
				tooltip: '改变帐号状态',
			    getClass:function(v,m,r,rIndex,cIndex,store){
					if (r.get('enabled')){
						return 'unlock';
					}else{
						return 'lock'
					}
			    },
			    handler: function(grid, rowIndex, colIndex) {
			        var rec = grid.getStore().getAt(rowIndex);
			        rec.set("enabled",!rec.get("enabled"));
			        rec.commit();
			    }
			}]

其中ms.gif是一个16*16的透明gif图像.....至此解决问题。。。。
其它更详细的可以参考它的API文档。
2
0
分享到:
评论
3 楼 andy_ghg 2011-12-05  
zp840566233 写道
text不起作用 可用 header ,iconCls不知所云 需要把图片样式设置宽高!如:
.icon-class {
height: 16px;
  width: 16px;
    background-image: url(../images/button/class.gif) !important;
}

谢谢指点
2 楼 zp840566233 2011-12-05  
text不起作用 可用 header ,iconCls不知所云 需要把图片样式设置宽高!如:
.icon-class {
height: 16px;
  width: 16px;
    background-image: url(../images/button/class.gif) !important;
}
1 楼 zhouzhiyong 2011-11-24  
header: 'Options',  这个就好了 你多虑了

相关推荐

Global site tag (gtag.js) - Google Analytics