PDA

View Full Version : A custom config cannot override a reserved member message



gatherworks
17 Apr 2012, 6:11 AM
After upgrading this message keeps popping up multiple times and keeps repeating for about a dozen times:
"A custom config cannot override a reserved member message"

I am pretty sure this is caused by overriding onTriggerClick for Ext.form.field.Trigger. According to the docs this is allowed and in fact created for this sole purpose:

onTriggerClick (http://localhost/extjs41/docs/#!/api/Ext.form.field.Trigger-method-onTriggerClick)( Ext.EventObject (http://localhost/extjs41/docs/#!/api/Ext.EventObject) e )PROTECTED
The function that should handle the trigger's click event. This method does nothing by default until overridden by an implementing function. SeeExt.form.field.ComboBox (http://localhost/extjs41/docs/#!/api/Ext.form.field.ComboBox) and Ext.form.field.Date (http://localhost/extjs41/docs/#!/api/Ext.form.field.Date) for sample implementations.

Phil.Strong
17 Apr 2012, 6:19 AM
Could you send us your project or a sample one showing the the issue?

Easier would be 5 steps to create the project. Your call

aconran
17 Apr 2012, 6:23 AM
You have probably added a custom config for one of the following which is not allowed...
alias
alternateClassName
config
extend
inheritableStatics
mixins
singleton
statics
requires
uses
initComponent
refs
controllers
models
stores
views
items
fields
proxy
validations
belongsTo
hasMany
hasOne
xtype

Any of those ring a bell?

gatherworks
17 Apr 2012, 12:14 PM
I belief I have. The message does not show on restart and Architect behaves as expected. We can close this one.

Thanks!

Fibon
4 Jul 2013, 1:20 AM
Hi,

I'm following some examples on Sencha MVC Architecture and I came across this problem

" function cannot override a reserved member"

this happens after i add initComponent


Ext.define('AppMVC.view.user.Edit', {
extend: 'Ext.window.Window',
alias: 'widget.useredit',


requires: [
'Ext.form.Panel'
],


autoShow: true,
height: 120,
width: 280,
layout: {
type: 'fit'
},
title: 'Edit user',


initComponent: function() {
var me = this;


me.callParent(arguments);
}


});

im using Sencha Architect Version: 2.2.2 Build: 991
Ext JS 4.2.x


Any way I can add


initComponent: function() {
this.items = [
{
xtype: 'form',
padding: '5 5 0 5',
border: false,
style: 'background-color: #fff;',
items: [
{
xtype: 'textfield',
name : 'name',
fieldLabel: 'Name'
},
{
xtype: 'textfield',
name : 'email',
fieldLabel: 'Email'
}
]
}
];

this.buttons = [
{
text: 'Save',
action: 'save'
},
{
text: 'Cancel',
action: 'cancel'
}
];
this.callParent(arguments);
}



on this code without getting this error?

Thanks

aconran
5 Jul 2013, 12:01 PM
Add a form with two textfields in it and configure it appropriately.

Add a toolbar with two buttons and configure it appropriately (dock the toolbar to the bottom and set a ui of 'footer'). Also you should add a fill item if you want the Save/Cancel buttons to be flush right.

Below is a quick attempt to match what I think you want built in architect.

Generated Code:


Ext.define('AppMVC.view.user.Edit', {
extend: 'Ext.window.Window',
alias: 'widget.useredit',

height: 140,
width: 280,
layout: {
type: 'fit'
},
title: 'Edit User',

initComponent: function() {
var me = this;

Ext.applyIf(me, {
dockedItems: [
{
xtype: 'toolbar',
dock: 'bottom',
ui: 'footer',
items: [
{
xtype: 'tbfill'
},
{
xtype: 'button',
text: 'Save'
},
{
xtype: 'button',
text: 'Cancel'
}
]
}
],
items: [
{
xtype: 'form',
border: false,
bodyPadding: 10,
items: [
{
xtype: 'textfield',
anchor: '100%',
fieldLabel: 'Name'
},
{
xtype: 'textfield',
anchor: '100%',
fieldLabel: 'Email',
vtype: 'email'
}
]
}
]
});

me.callParent(arguments);
}

});


And the attached xdc to import to your toolbox (right click on toolbox item and click import from file..) You can then drag out the userEdit component to your canvas.
44748