Pages

Showing posts with label extjs viewport reference center region controller. Show all posts
Showing posts with label extjs viewport reference center region controller. Show all posts

Friday, January 6, 2012

An easy way to get a reference to the viewport from any controller

Here's an easy way to get a reference to your viewport from any controller:

Ext.application({

  launch: function(){

    this.viewport = Ext.ComponentQuery.query('viewport')[0];


    this.centerRegion = this.viewport.down('[region=center]');

  }

});

then, inside say, a controller, you can call this:

this.application.viewport

to get a reference to the viewport.