-
1 Aug 2012 11:42 AM #1
Unanswered: reference container config inside items config
Unanswered: reference container config inside items config
I have a custom config that I want to reference inside the items config of a container. How do I do this?
Code:Ext.define( 'App.view.View',{ extend: 'Ext.Container', config: { model: null, //Custom config items: [ { title: 'Nested View', xtype: 'view', record: this.getModel() //How do I reference my custom config model here? } ] } } );
-
1 Aug 2012 12:43 PM #2
You can try something like this:
You can set your custom model config when using Ext.create()Code:Ext.define('App.view.View',{ extend: 'Ext.Container', config: { //... }, initialize: function(){ var me = this, c = me.config; me.add({ title: 'Nested View', xtype: 'view', record: c.model }); me.callParent(arguments); } });
Code:Ext.create('App.view.View', { model: //reference your model here });


Reply With Quote