PDA

View Full Version : extending panel and add new method



mr.xprt
20 Jun 2011, 12:16 PM
hi ,

am trying to extend Panel and add new Method to it to modify some properties of it

my code :

Ext.setup({
icon: 'icon.png',
tabletStartupScreen: 'tablet_startup.png',
phoneStartupScreen: 'phone_startup.png',
glossOnIcon: false,
//launch :function(){
onReady :function(){
var cmp = this;



MyNewPanel=Ext.extend(Ext.Panel,{
fullscreen:true,
html:'hi'
});
p=new MyNewPanel({

});
p.changeHtmlTo('Hi Am Changed ');
}

});

so where i have to put the defination of the new method

function changeHtmlTo(html){
MyNewPanel.update(MyNewPanel);
}

it's not about changing the panel's html but the method is only for example

thanks :)

jmclem
21 Jun 2011, 10:18 PM
Hi,

here:


MyNewPanel=Ext.extend(Ext.Panel,{
fullscreen:true,
html:'hi',
changeHtmlTo: function (h) {
//do whatever you want
}
});


Jean-Marie.

mr.xprt
22 Jun 2011, 9:17 AM
thanks alot :)

nish1013
13 Apr 2012, 7:10 AM
Hi,

here:


MyNewPanel=Ext.extend(Ext.Panel,{
fullscreen:true,
html:'hi',
changeHtmlTo: function (h) {
//do whatever you want
}
});


Jean-Marie.

Cheers Jean , help for me too :)