View Full Version : defaultTarget: "viewport" WHAT DOES IT DO??

24 Jun 2011, 4:28 PM
So I start an application like this in app.js :

Ext.regApplication('MYAPP', {
name : "MYAPP",
defaultTarget : "viewport",
defaultUrl : 'MYAPP/index',
useHistory : true,

launch: function() {

this.viewport = new MYAPP.Viewport();



MYAPP.Viewport class code :

MYAPP.Viewport = Ext.extend(Ext.Panel, {
fullscreen: true,
layout: 'card'

"defaultUrl: 'MYAPP/index'" will fire controller's index action which uses "this.application.viewport.SetActiveItem" to render a view.

What I dont understand is what does "defaultTarget: "viewport"" does in Ext.application?

Thanks for any inputs you may have.

25 Jun 2011, 2:17 AM
afaik, the 'defaultTarget' is the target where a config will be rendered to when you use the Ext.Controller.render() function.

setActiveItem only activates an already existing component.