javascript - Is there any viewWillAppear like-function in Sencha Touch -
i trying call function every time when view shows up. gets called first time , thenafter doesn't. there event-function viewwillappear of ios. using 'initialize' event function , gets called once. please help.
view:
ext.define('abc.view.abc', { extend: 'ext.list', xtype: 'runninglist', requires: ['abc.store.instancesstore','ext.data.proxy.jsonp',], config: { title: 'running', id: 'instancelist',/* itemtpl: '<div class="serached_listview">'+ '<div>{key} {key} </div>' + '<div><b>{key}</b> </div>' + '<div> {key}</div>' + '</div>' ,*/ store: 'runninginstancestore', listeners: [{ fn: 'initialize', event: 'initialize' } ] } });
controller:
ext.define("abc.controller.instancescontroller", { extend: 'ext.app.controller', requires: [ 'ext.data.jsonp','ext.device.connection'], config: { refs: { main: 'mainpanel', instances: '#instancelist', listview: 'runninglist' }, control: { instances: { initialize: 'initializepanel', activate:'initializepanel' }, "runninginstanceslist": { disclose: 'listviewaccessorytapped', itemtap: 'listviewtapped' } } }, listviewaccessorytapped: function(view, index, item, e) { if(ext.device.connection.isonline()) console.log('internet connection available.'); else console.log('internet connection not available.'); }, listviewtapped: function(view, index, item, e) { }, initializepanel: function() { console.log('hi'); **////////////////called once...** } });
in extjs there component.beforeactivate, fires each time before component activated
http://docs.sencha.com/ext-js/4-1/#!/api/ext.abstractcomponent-event-beforeactivate
however, in touch, there appears container.activate, looks fired after child component activated
http://docs.sencha.com/touch/2-1/#!/api/ext.container-event-activate
Comments
Post a Comment