PDA

View Full Version : New PR4 refs documentation missing something?



bweiler
24 Jan 2012, 9:13 AM
I'm trying to get the new ref structure working and I'm running into some problems. The getRefname structure used to work and now it doesn't even though I'm using the refs as documented in PR4. Am I missing something?

BTW: The new refs structure is much better than the old way.



refs: {
mainTitleBar: 'mainview titlebar',
},




Ext.define('MyApp.view.Main', {
extend: 'Ext.Container',

config: {

layout: 'card',
items: [
{
xtype: 'titlebar',
docked: 'top',
items: [
{
xtype: 'button',
itemId: 'homeButton',
iconCls: 'home',
iconMask: true,
ui: 'plain',
align: 'left'
},

...




this.getMainTitleBar().setTitle(this.appTitle);

TypeError: 'undefined' is not an object (evaluating 'this.getMainTitleBar().setTitle')

mitchellsimoens
24 Jan 2012, 9:52 AM
It looks like your MyApp.view.Main class doesn't have an xtype assigned to it.

bweiler
24 Jan 2012, 10:04 AM
The xtypes used to be created automatically in previous PR versions. I'm not sure why this would change, but I do like the new ref structure.

Thanks!

mitchellsimoens
24 Jan 2012, 10:08 AM
The xtypes used to be created automatically in previous PR versions. I'm not sure why this would change, but I do like the new ref structure.

Thanks!

You should always define your own xtype.

rdougan
24 Jan 2012, 11:27 AM
The xtypes used to be created automatically in previous PR versions. I'm not sure why this would change, but I do like the new ref structure.

Thanks!

Yup, this happened in the old MVC - but we don't think it makes sense and that it is too much magic. You'll need to define your types manually as Mitchell said. :)

edspencer
24 Jan 2012, 3:29 PM
Yea this was overlooked in the migration guide, I'll update it