PDA

View Full Version : Help, TabPanel Update contents dynamically????



javichu
7 Sep 2011, 1:35 AM
Hi, how I can update the contents of a TabPanel(tab2) dynamically from a url ???
Code:
........
.......
varr tab1 = new Ext.Panel ({
id: 'section1',
title: 'P1',
autoScroll: true,
width:980,
height:500,
html: 'Hola'
});
var tab2 = new Ext.Panel ({
id: 'section2',
title: 'P2',
autoScroll: true,
width:980,
height:500
});
var tabs = Ext.createWidget('tabpanel', {
activeTab: 0,
bodyPadding: '2 2',
items: [tab1,tab2]
});
.............
.............
updatetabpanel();
..............
..............
function updatetabpanel(){
var tabpanel1=Ext.getCmp('section2');

tabpanel1.loader({//not working
url: 'info.php',
contentType: 'html',
timeout:120000,
autoLoad: true,
params: 'foo=123&bar=abc'
});

//or

tabpanel1.add({//not working
url: 'info.php',
contentType: 'html',
timeout:120000,
autoLoad: true,
params: 'foo=123&bar=abc'
});


}

vasm
7 Sep 2011, 2:36 AM
Try this


tabpanel1.add({
autoLoad: {
url:"info.php",
scripts:true,
params: {
foo:'123',
bar:'abc'
}
}
});

javichu
7 Sep 2011, 3:27 AM
Thanks, working OK.