Extjs Ext JS 6.5-禁用现代网格不工作
我正在开发ExtJS6.5Modern。我有一些条件来禁用Extjs Ext JS 6.5-禁用现代网格不工作,extjs,extjs6-modern,extjs6.5,Extjs,Extjs6 Modern,Extjs6.5,我正在开发ExtJS6.5Modern。我有一些条件来禁用网格组件,用户只有查看网格的权限,其他人无权查看 我尝试过配置和方法,但不起作用。这是我的名片 代码片段 Ext.application({ name: 'Fiddle', launch: function () { Ext.create('Ext.data.Store', { storeId: 'gridStore', fields: ['name']
网格
组件,用户只有查看网格
的权限,其他人无权查看
我尝试过配置和方法,但不起作用。这是我的名片
代码片段
Ext.application({
name: 'Fiddle',
launch: function () {
Ext.create('Ext.data.Store', {
storeId: 'gridStore',
fields: ['name'],
data: [{
name: 'Test 1'
}, {
name: 'Test 2'
}, {
name: 'Test 3'
}, {
name: 'Test 4'
}]
});
Ext.create({
xtype: 'grid',
layout: 'fit',
fullscreen: true,
title: 'Baisc grid example',
store: 'gridStore',
//Here I have put {disabled: true} but not working
disabled: true,
columns: [{
text: 'Name',
flex: 1,
dataIndex: 'name'
}],
listeners: {
childtap: function (grid, location, eOpts) {
alert('childtap');
}
},
items: [{
xtype: 'toolbar',
items: {
xtype: 'button',
ui: 'action',
text: 'Disabled grid',
iconCls: 'x-fa fa-ban',
handler: function () {
//IT is also not working
this.up('grid').setDisabled(true);
this.up('grid').disable();
}
}
}]
//renderTo:Ext.getBody()
});
}
});
有人请帮助我禁用
网格组件的解决方案。作为一种解决方法,我们可以使用grid.setMasked(true)代码>
以下是示例。另一种方法是将grid
的hideMode
设置为opacity
,然后将其设置为hidden
(this.up('grid').setHidden(true);
)
例如(编辑小提琴)
您还需要此css覆盖:
<style>
.x-hidden-opacity {
opacity: 0.2 !important; //default is 0
pointer-events: none;
}
</style>
.x-隐藏-不透明度{
不透明度:0.2!重要;//默认值为0
指针事件:无;
}
您可能需要向Sencha提交一个bug,并使用if(grid.isDisabled())返回代码>同时在您的childtap活动中。好的,我将报告sencha forumgood idea上的错误。我将在我的申请中应用这个。谢谢你的解决方案
<style>
.x-hidden-opacity {
opacity: 0.2 !important; //default is 0
pointer-events: none;
}
</style>