PDA

View Full Version : I need help



chronic
27 Mar 2011, 2:25 AM
hello,
I would like to create a function which will allow me to get a region in a viewport. then I could call this function in another class where I could construct my components. a bit as in java swing.
like this:

App.MyScreen = function(){};

App.MyScreen.prototype = function(){
var layout,
myFunction:function(){
this.layout = new Ext.Viewport({
layout:'border',
items:[
{region:'center',
...........
},{region:'west'}
]
});
myFunction2: function(){
return component;
}
};

App.MyLook = function(){
App.MyLook.superclass.constructor.call(this);
};
Ext.extend(App.MyScreen,
{
myFunction2:function(){
//I recover a region of the viewport of the screen and I add my component.
}
}

Is it possible?(:|

kohyea
28 Mar 2011, 12:44 PM
Try this:


App.MyScreen.prototype = {
myFunction: function(){
this.centerRegion = new Ext.Container({
region:'center'
});
this.westRegion = new Ext.Container({
region:'west'
});
this.layout = new Ext.Viewport({
layout:'border',
items:[this.centerRegion, this.westRegion]
});
},
getCenterRegion: function(){
return this.centerRegion;
},
getWestRegion: function() {
return this.westRegion;
}
};

tryanDLS
28 Mar 2011, 3:46 PM
You're much more likely to get help if you give your thread a useful title and post properly.
http://sencha.com/learn/Ext_Forum_Help