mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-05-07 16:10:35 +00:00
set default focus and default button for edit window
this patch sets following defaults for the edit window: defaultFocus: 'field' sets the focus on the first field it finds in its child items, works for most edit windows, so that the cursor stands in a textfield, or on a checkbox defaultButton: 'submitbutton' so that when someone presses enter, we submit the form Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
452892dfba
commit
a7dcbdebb9
@ -25,6 +25,14 @@ Ext.define('Proxmox.window.Edit', {
|
|||||||
|
|
||||||
backgroundDelay: 0,
|
backgroundDelay: 0,
|
||||||
|
|
||||||
|
// needed for finding the reference to submitbutton
|
||||||
|
// because we do not have a controller
|
||||||
|
referenceHolder: true,
|
||||||
|
defaultButton: 'submitbutton',
|
||||||
|
|
||||||
|
// finds the first form field
|
||||||
|
defaultFocus: 'field',
|
||||||
|
|
||||||
showProgress: false,
|
showProgress: false,
|
||||||
|
|
||||||
isValid: function() {
|
isValid: function() {
|
||||||
@ -225,6 +233,7 @@ Ext.define('Proxmox.window.Edit', {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var submitBtn = Ext.create('Ext.Button', {
|
var submitBtn = Ext.create('Ext.Button', {
|
||||||
|
reference: 'submitbutton',
|
||||||
text: submitText,
|
text: submitText,
|
||||||
disabled: !me.create,
|
disabled: !me.create,
|
||||||
handler: function() {
|
handler: function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user