PDA

View Full Version : loader issue



mario60
8 Jan 2012, 12:02 PM
Hello

something which is baffling me.
I have the following tabpanel


var tabA = Ext.createWidget('tabpanel', {
renderTo: 'tabA',
activeTab: 0,
width: 600,
height: 250,
plain: true,
defaults :{
autoScroll: true,
bodyPadding: 10
},
items: [{
title: 'AAA',
loader: {
url: 'myfile.php',
loadMask: true
},
listeners: {
activate: function(tab) {
tab.loader.load();
}
}
},{
title: 'BBB',
loader: {
url: 'myfile.php',
autoLoad: true,
params: 'par=B'
}
}, {
title: 'CCC',
loader: {
url: 'myfile.php',
autoLoad: true,
params: 'par=C'
}
}
]
});

If I return $POST, I get either

Array ( [0] => p [1] => a [2] => r [3] => = [4] => B )
or

Array ( [0] => p [1] => a [2] => r [3] => = [4] => C )

(instead of

Array ( [par] => B) or Array ( [par] => C)

What do I do wrong?
help is very appreciate
thks
mario

ps. I get what I need by using

loader: {
url: 'myfile.php?par=B',
autoLoad: true
}
still it could be useful to use params.

mitchellsimoens
9 Jan 2012, 8:24 AM
I would use params like this:


params : {
p : 0,
q : 1
}

If it is a GET request then they should be url encoded and appended to the url.

mario60
10 Jan 2012, 9:03 AM
params: '{par : AA}'
is not working for me.
thks anyway
m.

mitchellsimoens
10 Jan 2012, 9:10 AM
You are once again passing a string. My code was an Object.

mario60
11 Jan 2012, 12:26 AM
I see your point now:

params : { par : 'AA' } works!

thanks so much
mario

ps
params : { par : AA } does not work; 'AA' is still a string, of course!