3
A
回答
0
一種解決方案是,以防止任何小區的選擇:
var myPropertyGrid = Ext.create('Ext.grid.property.Grid', { ... });
myPropertyGrid.getSelectionModel().setLocked(true);
5
另一種解決方案是增加一個監聽器,其防止在開始編輯部分:
listeners: {
'beforeedit': {
fn: function() {
return false;
}
}
}
的問題與這種解決方案是,不能將單元格標記爲複製(Ctrl + C)內容。
1
使用sourceConfig
到編輯器設置爲Ext.form.DisplayField
:
Ext.create('Ext.grid.PropertyGrid', {
sourceConfig: {
field1: {
displayName: 'Editable Field'
},
field2: {
displayName: 'Readonly Field',
editor: Ext.create('Ext.form.DisplayField')
}
},
source: {
field1: "Some property",
field2: "Some other property",
}
});
1
還有一個決定,但不允許在其後選擇文本:myGrid.findPlugin('cellediting').disable();
+0
這在extjs 6.5.3中爲我工作。我在afterrender事件處理程序中進行了調用。 – costa
0
Ext.define('MyPropertyGrid', {
extend: 'Ext.grid.property.Grid',
xtype: 'mypropertygrid',
source: {
field1: 'value of field1',
field2: 'value of field2'
},
sourceConfig: {
field1: {
editor: {disabled: true}
},
field2: {
editor: {disabled: true}
}
}
});
我測試它的ExtJS 6.0 。
+0
儘管這段代碼可能會回答這個問題,但最好包含一些_context_,解釋_how_它的工作原理和_when_使用它。從長遠來看,僅有代碼的答案是沒有用的。 –
相關問題
- 1. PropertyGrid只讀對象級屬性
- 2. 在PropertyGrid中動態設置屬性的只讀屬性
- 3. C#PropertyGrid - 如何使數組元素只讀?
- 4. 更改屬性屬性就像只讀在設計時(PropertyGrid中)
- 5. 使繼承的值不是可瀏覽/只PropertyGrid中讀
- 6. C#:PropertyGrid中只有通過BrowsableAttributes
- 7. 從PropertyGrid的FloatProperty中讀取值
- 8. 在PropertyGrid中設置ReadOnly屬性將所有屬性設置爲只讀
- 9. wpf propertyGrid
- 10. Readonly PropertyGrid
- 11. PropertyGrid替代
- 12. Winforms PropertyGrid風格
- 13. Get PropertyGrid TextBox
- 14. WPF PropertyGrid問題
- 15. PropertyGrid RTL支持
- 16. PropertyGrid清除值
- 17. PropertyGrid中的ContextMenuStrip
- 18. Windows窗體:PropertyGrid
- 19. PropertyGrid中的
- 20. PropertyGrid中和TypeConverterAttribute
- 21. WpfToolkit PropertyGrid的
- 22. PropertyGrid GenericList與GenericItems
- 23. PropertyGrid for Silverlight
- 24. 使用Xceed PropertyGrid
- 25. 的WinForms PropertyGrid的
- 26. 使用PropertyGrid
- 27. PropertyGrid +接口
- 28. C#PropertyGrid拖放
- 29. c#PropertyGrid雙擊
- 30. 只讀
我還沒有嘗試過,但有一個禁用的配置,默認爲false,請嘗試將其設置爲true? – Amalea
@Amalea不錯的主意,但它只是完全禁用了這個東西,給出了一個空的灰色面板(正如你所期望的我猜) –
......實際上沒有,它顯示的屬性,但在半透明的灰色面具下。它應該工作,如果我能以某種方式擺脫那個面具 –