sencha touch - Push view instance of controller to NavigationView -


i'm trying add navigation in application. have controllers defined in application can reach them this.getapplication().getcontroller('somecontroller'). want push view instance of somecontroller on navigationview. works fine using push({xtype: 'someview'}) in controller, if try change view, says it's undefined.

i think because view i've pushed not same 1 of controller. here's code sample of controller:

config: {     refs: {         someview: {              selector: '#someview',             xtype: 'someview'         }     }, }, store: null, setstore: function(){  //creating store...  //...  someview.setstore(this.store); } 

and view:

ext.define('epamobile.view.someview', { extend: 'ext.dataview.list', alias: 'widget.someview', xtype: 'someview', requires: ['ext.field.search', 'ext.toolbar'], 

give view itemid used selector when referenced in controller. alias , xtype same thing stick alias , remove xtype. view should this:

ext.define('epamobile.view.someview', {     extend: 'ext.dataview.list',     alias: 'widget.someview',     requires: ['ext.field.search', 'ext.toolbar'],     config: {         ...         itemid: 'someviewitemid',                 ...     }      ... } 

lastly modify ref block this:

... refs: {     someview: {         selector: '#someviewitemid',         xtype: 'someview',         autocreate: true     } }, ... 

you should able use push({xtype: 'someview'}) without getting undefined error.


Comments