[英]Customizing ExtJs Tree Grid panel
I am using ExtJs 4.1 and want to utilize ExtJs-TreeGrid . 我正在使用ExtJs 4.1,并想利用ExtJs-TreeGrid 。 Please look at the example of the grid here
请在这里查看网格的示例
I want to add following feature to this grid: 我想向此网格添加以下功能:
See my answer here . 在这里查看我的答案。
To disable certain checkboxes you will need to slightly change the the renderer / processEvent methods. 要禁用某些复选框,您将需要稍微更改renderer / processEvent方法。 Since I don't know which checkboxes you want to disable, I'll just use a dummy function where you will need to provide your condition:
由于我不知道要禁用哪个复选框,因此我将使用一个虚拟函数来提供条件:
Ext.define('My.tree.column.CheckColumn', {
extend: 'Ext.ux.CheckColumn',
alias: 'widget.mytreecheckcolumn',
processEvent: function(type, view, cell, recordIndex, cellIndex, e, record, row) {
if (record.isLeaf() && !record.get('disabled')) {
return this.callParent(arguments);
}
else {
return My.tree.column.CheckColumn.superclass.superclass.processEvent.apply(this, arguments);
}
},
renderer : function(value, meta, record) {
if (record.isLeaf()) {
if (record.get('disabled')) {
meta.tdCls += ' ' + this.disabledCls;
}
return this.callParent([value, meta]);
}
return '';
}
});
Also note that by default this.disabledCls
is x-item-disabled
and will not provide any visible change to your column. 还要注意,默认情况下,
this.disabledCls
是x-item-disabled
,不会对您的列提供任何可见的更改。 For example, if you wanted to change the opacity of a disabled checkbox, you will need to provide your own disabledCls
例如,如果要更改禁用复选框的不透明度,则需要提供自己的
disabledCls
{
xtype: 'mytreecheckcolumn',
dataIndex: 'active',
disabledCls: 'x-grid-cell-checkcolumn-disabled'
}
and use some CSS: 并使用一些CSS:
.x-grid-cell-checkcolumn-disabled {
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=30);
opacity: 0.3;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.