extjs - Best practices for initializing and deconstructing controllers -
when building application best way setup controllers?
i understand routing, event listeners, , interactivity should managed controllers, main controller starting grow out of control , i'm not sure how best separate logic separate controllers without keeping them "running" time...
it's okay have them loaded @ app start-up, hundreds thousands of controllers. it's view rendering takes time.
make sure app minimized , concatenated though, using sencha cmd.
in test, created 1000 simple controllers, this:
ext.define('app.controller.controllern', { extend: 'ext.app.controller', init: function(application) { this.control({ buttonn1: { click: function() { } }, buttonn2: { click:function(){} }, ... 20 listeners }); } }); i concatenated them 1 file, , loaded them in app.js this:
ext.application({ name:'app', controllers:[ 'controller0', 'controller1' ... 1000 controllers ], launch:function(){} } it took 1 second browser refresh (chrome) until last controller's init method called.
Comments
Post a Comment