PDA

View Full Version : keyword this not work



igi
23 Jun 2009, 4:54 AM
i plan create formpanel to upload file, but something error with this

var panel = {
xtype : 'panel',
fileUpload : true,
<--cut-->
buttons :[{
text : 'Save',
handler :function({
panel.getForm() ---------> error this line because panel is undefined
<--cut-->
}

i try to replace panel with "this", so, it looks like this.getForm(), but not work too..
but if second step works
var panel = new Ext.formFormPanel({
xtype : 'panel',
fileUpload : true,
<--cut-->
buttons :[{
text : 'Save',
handler :function({
panel.getForm() ---------> error this line because panel is undefined
<--cut-->
});

i want to implements first step, so, any keyword to replace panel.getForm() ??

sorry, my english bad..

thx

Condor
23 Jun 2009, 5:16 AM
handler: function(){
var button = this, toolbar = button.ownerCt, panel = toolbar.ownerCt;
...
}