[pve-devel] [PATCH pve-manager] SafeDestroy.js: allow to submit the form with Enter key

Emmanuel Kasper e.kasper at proxmox.com
Mon Apr 4 11:52:44 CEST 2016


On 03/31/2016 10:29 AM, Dietmar Maurer wrote:
> 
>> @@ -102,7 +108,12 @@ Ext.define('PVE.window.SafeDestroy', {
>>  			fieldLabel: gettext('Please enter the {item.type} ID to confirm'),
>>  		    },
>>  		    hideTrigger: true,
>> -		    allowBlank: false
>> +		    allowBlank: false,
>> +		    listeners: {
>> +			afterrender: function(field) {
>> +			    field.focus(10);
>> +			}
>> +		    }
> 
> Can we move this code to the ViewController instead?
> 

On second thought, it would be maybe even better to use the framework
focus handling helpers like

Ext.define('PVE.window.SafeDestroy', {
     bodyPadding: 10,
     width: 450,
     layout: 'hbox',
+    defaultFocus: 'confirmField',

and

                    reference: 'confirmField',
+                   itemId: 'confirmField',
                    xtype: 'numberfield',
                    name: 'confirm',
                    labelWidth: 300,


like we use for the Login Window ?

I'll send a V2 patch with this.









More information about the pve-devel mailing list