public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH widget-toolkit] form: combo grid: use correct method to initialize the picker
@ 2023-03-31 10:04 Dominik Csapak
  2023-04-12 11:46 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Dominik Csapak @ 2023-03-31 10:04 UTC (permalink / raw)
  To: pve-devel

'createPicker' does create the picker, but not all necessary
initialization for the combobox (namely it does not set the owner field,
but that's only an implementation detail). Instead 'getPicker' should be
used for that, since that does all the necessary initialization and is
the same function used when trying to open it.

Without this patch, we leak the picker that was created with this
call every time a combogrid is created.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 src/form/ComboGrid.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/form/ComboGrid.js b/src/form/ComboGrid.js
index 29c3d26..55dee7e 100644
--- a/src/form/ComboGrid.js
+++ b/src/form/ComboGrid.js
@@ -408,7 +408,7 @@ Ext.define('Proxmox.form.ComboGrid', {
 
 	// Create the picker at an early stage, so it is available to store the previous selection
 	if (!me.picker) {
-	    me.createPicker();
+	    me.getPicker();
 	}
 
 	me.mon(me.store, 'beforeload', function() {
-- 
2.30.2





^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pve-devel] applied: [PATCH widget-toolkit] form: combo grid: use correct method to initialize the picker
  2023-03-31 10:04 [pve-devel] [PATCH widget-toolkit] form: combo grid: use correct method to initialize the picker Dominik Csapak
@ 2023-04-12 11:46 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2023-04-12 11:46 UTC (permalink / raw)
  To: Proxmox VE development discussion, Dominik Csapak

Am 31/03/2023 um 12:04 schrieb Dominik Csapak:
> 'createPicker' does create the picker, but not all necessary
> initialization for the combobox (namely it does not set the owner field,
> but that's only an implementation detail). Instead 'getPicker' should be
> used for that, since that does all the necessary initialization and is
> the same function used when trying to open it.
> 
> Without this patch, we leak the picker that was created with this
> call every time a combogrid is created.
> 
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
>  src/form/ComboGrid.js | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
>

applied, but reworded to clarify that the actual issue was that the created
picker was not saved to the field's me.picker state variable (which the
field's doDestroy checks for), thanks!




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-04-12 11:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-31 10:04 [pve-devel] [PATCH widget-toolkit] form: combo grid: use correct method to initialize the picker Dominik Csapak
2023-04-12 11:46 ` [pve-devel] applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal