PDA

View Full Version : Pass arguments to Extended Panel



inhib
21 Jul 2008, 2:07 AM
Hi,

Maybe my english level isn't high enough, I do not understand completely mjlecomte (http://extjs.com/forum/member.php?u=6834) 's tutorial.

I have an extended panel :
MyDesktop.Article.OngletArti= Ext.extend(Ext.Panel,{
...
})
I use it in a TabPanel, but I would like to pass some values when I make my :

MyTabPannel.add(new MyDesktop.Article.OngletArti(value))

I have tried this :


MyDesktop.Article.OngletArti= Ext.extend(Ext.Panel,{
title: 'Fiche article',
layout:'border',
closable:true,
initComponent: function(MyValue) {
...
... triing to use MyValue
...
MyDesktop.Article.OngletArti.superclass.initComponent.call(this);
}
})

When I try to call the constructor with new MyDesktop.Article.OngletArti('myvalue) I get a :


this.el is null
chrome://firebug/content/blank.gifExt.Component=function(B){B=B||{};if(B.i...)}});Ext.reg("component",Ext.Component);


Does anybody have an idea ?

Thanks

evant
21 Jul 2008, 2:24 AM
MyTabPannel.add(new MyDesktop.Article.OngletArti({myValue: 'foo'}));

MyDesktop.Article.OngletArti= Ext.extend(Ext.Panel,{
title: 'Fiche article',
layout:'border',
closable:true,
initComponent: function() {
alert(this.myValue);
MyDesktop.Article.OngletArti.superclass.initComponent.call(this);
}
})

inhib
21 Jul 2008, 3:11 AM
Thanks a LOT !