From: Fiona Ebner <f.ebner@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: Re: [pbs-devel] [PATCH v2 widget-toolkit] form: display-edit: support emptyText
Date: Tue, 26 Nov 2024 17:25:15 +0100 [thread overview]
Message-ID: <33c92137-b2cb-4e91-820d-bd3d96756662@proxmox.com> (raw)
In-Reply-To: <20241126162005.85583-2-f.ebner@proxmox.com>
Am 26.11.24 um 17:20 schrieb Fiona Ebner:
> To access the edit field, its xtype is now tracked.
>
> 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>
> ---
>
> Changes in v2:
> * avoid tracking emptyText state twice, pass directly to edit field.
>
> src/form/DisplayEdit.js | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/src/form/DisplayEdit.js b/src/form/DisplayEdit.js
> index fe1b83b..01d6a05 100644
> --- a/src/form/DisplayEdit.js
> +++ b/src/form/DisplayEdit.js
> @@ -12,6 +12,9 @@ Ext.define('Proxmox.form.field.DisplayEdit', {
>
> displayType: 'displayfield',
>
> + // internal only, use editConfig to set the xtype
> + _editType: 'textfield',
> +
> editConfig: {},
> editable: false,
> setEditable: function(editable) {
> @@ -41,6 +44,15 @@ Ext.define('Proxmox.form.field.DisplayEdit', {
> vm.get('value');
> },
>
> + setEmptyText: function(emptyText) {
> + let me = this;
> + me.down(me._editType).setEmptyText(emptyText);
> + },
> + getEmptyText: function() {
> + let me = this;
> + return me.down(me._editType).getEmptyText();
> + },
> +
> layout: 'fit',
> defaults: {
> hideLabel: true,
> @@ -64,6 +76,8 @@ Ext.define('Proxmox.form.field.DisplayEdit', {
> });
> Ext.applyIf(editConfig, displayConfig);
>
> + me.__editType = editConfig.xtype;
Sorry, there is a typo here, __editType instead of _editType
> +
> if (me.initialConfig && me.initialConfig.displayConfig) {
> Ext.applyIf(displayConfig, me.initialConfig.displayConfig);
> delete displayConfig.displayConfig;
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
next prev parent reply other threads:[~2024-11-26 16:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-26 16:20 [pbs-devel] [PATCH v2 proxmox-widget-toolkit/proxmox-backup 0/2] ui: slightly improve removable datastore dialog Fiona Ebner
2024-11-26 16:20 ` [pbs-devel] [PATCH v2 widget-toolkit] form: display-edit: support emptyText Fiona Ebner
2024-11-26 16:25 ` Fiona Ebner [this message]
2024-11-26 16:20 ` [pbs-devel] [PATCH v2 proxmox-backup 2/2] ui: datastore edit: fix emptytext for path field Fiona Ebner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=33c92137-b2cb-4e91-820d-bd3d96756662@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox