mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-15 09:46:16 +01:00
added afterrender listener to Sonia.rest.EditForm for setting focus
This commit is contained in:
@@ -16,15 +16,9 @@ Sonia.group.EditForm = new Ext.extend(Sonia.rest.EditForm, {
|
|||||||
|
|
||||||
var config = {
|
var config = {
|
||||||
title: 'Edit Group',
|
title: 'Edit Group',
|
||||||
listeners: {
|
focusField: 'groupName',
|
||||||
afterrender: function(){
|
|
||||||
if ( ! update ){
|
|
||||||
Ext.getCmp('nameField').focus(true, 500);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
items:[{
|
items:[{
|
||||||
id: 'nameField',
|
id: 'groupName',
|
||||||
fieldLabel:'Name',
|
fieldLabel:'Name',
|
||||||
name:'name',
|
name:'name',
|
||||||
anchor: '100%',
|
anchor: '100%',
|
||||||
|
|||||||
@@ -13,8 +13,9 @@ Sonia.repository.EditForm = Ext.extend(Sonia.rest.EditForm, {
|
|||||||
|
|
||||||
var config = {
|
var config = {
|
||||||
title: 'Edit Repository',
|
title: 'Edit Repository',
|
||||||
|
focusField: 'repositoryName',
|
||||||
items:[
|
items:[
|
||||||
{fieldLabel: 'Name', name: 'name', readOnly: update, allowBlank: false},
|
{ id: 'repositoryName', fieldLabel: 'Name', name: 'name', readOnly: update, allowBlank: false},
|
||||||
{
|
{
|
||||||
fieldLabel: 'Type',
|
fieldLabel: 'Type',
|
||||||
name: 'type',
|
name: 'type',
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ Sonia.rest.EditForm = Ext.extend(Ext.form.FormPanel, {
|
|||||||
|
|
||||||
title: 'Edit REST',
|
title: 'Edit REST',
|
||||||
data: null,
|
data: null,
|
||||||
|
focusField: null,
|
||||||
|
|
||||||
initComponent: function(){
|
initComponent: function(){
|
||||||
|
|
||||||
@@ -45,6 +46,16 @@ Sonia.rest.EditForm = Ext.extend(Ext.form.FormPanel, {
|
|||||||
defaultType:'textfield',
|
defaultType:'textfield',
|
||||||
monitorValid: true,
|
monitorValid: true,
|
||||||
defaults: {width: 190},
|
defaults: {width: 190},
|
||||||
|
listeners: {
|
||||||
|
afterrender: {
|
||||||
|
fn: function(){
|
||||||
|
if ( this.focusField != null && this.data == null ){
|
||||||
|
Ext.getCmp(this.focusField).focus(true, 500);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
scope: this
|
||||||
|
}
|
||||||
|
},
|
||||||
buttons:[
|
buttons:[
|
||||||
{text: 'Ok', formBind: true, scope: this, handler: this.submit},
|
{text: 'Ok', formBind: true, scope: this, handler: this.submit},
|
||||||
{text: 'Cancel', scope: this, handler: this.cancel}
|
{text: 'Cancel', scope: this, handler: this.cancel}
|
||||||
|
|||||||
Reference in New Issue
Block a user