PDA

View Full Version : Transmission and class



Stephan123
26 Nov 2009, 7:12 AM
Hello !

I have build a simple class.
This class has a function.
The function 'init' call a window.
In the moment the title is (red)
I will change the title (green) with 'hallo'



Ext.ns('app');

app.modul = function(){

// begin public
return{
hallo: 'Test',

init: new Ext.Window({
// title: modul.superclass.hallo,
title: 'www',
width: 400,
height: 400
})
} // end public


}

var modul = new app.modul();
modul.init.show();How can help ?

Your sincerly

Stephan

(Sorry for my bad english)

fabio.parra
28 Nov 2009, 1:38 PM
Try this:




Ext.ns('app');

app.modul = function () {
var win = null;
return {

hallo: 'Hallo',

show: function () {
if (!win) {
win = new Ext.Window({
closeAction: 'hide',
title: this.hallo,
width: 400,
height: 400
});
} //eo if
return win.show();
} //eo show
} //eo return
} ();

Ext.onReady(function () {
//be sure to execute your code after Ext.onReady
var win = app.modul.show();
win.setTitle('Hallo');
//or
win.setTitle(app.modul.hallo);
});