mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-06-26 21:59:10 +00:00
display-edit field: add emptyText getter and setter to support data-bind
To access the underlying fields a reference to them is now explicitly saved after component initialisation. First user is intended to be the path field for datastores where the emptyText should dynamically be for a relative or absolute path. Signed-off-by: Fiona Ebner <f.ebner@proxmox.com> [ TL: switch over from saving the xtype to query in the getter or setter to directly savign a reference to the underlying fields. ] Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
c806b73ff7
commit
ac10db95ef
@ -41,6 +41,15 @@ Ext.define('Proxmox.form.field.DisplayEdit', {
|
|||||||
vm.get('value');
|
vm.get('value');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
setEmptyText: function(emptyText) {
|
||||||
|
let me = this;
|
||||||
|
me.editField.setEmptyText(emptyText);
|
||||||
|
},
|
||||||
|
getEmptyText: function() {
|
||||||
|
let me = this;
|
||||||
|
return me.editField.getEmptyText();
|
||||||
|
},
|
||||||
|
|
||||||
layout: 'fit',
|
layout: 'fit',
|
||||||
defaults: {
|
defaults: {
|
||||||
hideLabel: true,
|
hideLabel: true,
|
||||||
@ -99,6 +108,11 @@ Ext.define('Proxmox.form.field.DisplayEdit', {
|
|||||||
|
|
||||||
me.callParent();
|
me.callParent();
|
||||||
|
|
||||||
|
// save a reference to make it easier when one needs to operate on the underlying fields,
|
||||||
|
// like when creating a passthrough getter/setter to allow easy data-binding.
|
||||||
|
me.editField = me.down(editConfig.xtype);
|
||||||
|
me.displayField = me.down(displayConfig.xtype);
|
||||||
|
|
||||||
me.getViewModel().set('editable', me.editable);
|
me.getViewModel().set('editable', me.editable);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user