jaggybala
10-22-2007, 08:36 AM
Hi,
I am trying to update tab's content using Ajax and "update" function, but always get "tabs.getComponent(0).update is not a function" error. Here's the code:
var fldWinId = fld + "Window";
// Look up the button's Window and create it if it doesn't exist
var win = Ext.WindowMgr.get(fldWinId);
if (!win) {
win = new Ext.Window({
animateTarget: fld,
title: modeTitle,
width:680,
height:580,
minWidth:660,
minHeight:560,
closable: false,
closeAction: 'hide',
defaults:{autoHeight: true},
layout:'fit',
plain: modePlain,
items: {
xtype: 'tabpanel',
activeTab: 0,
items: [{
title: "Basic Info"
}, {
title: "Data Source"
}, {
title: "Data Display"
}]
},
buttons: [{
text: 'Close',
handler: function(){
win.hide();
}
}],
renderTo: Ext.getBody()
});
}
// Update the window's tab items.
Ext.Ajax.request({
url: modeUrl,
method: "GET",
success: function(e) {
var results = Ext.util.JSON.decode(e.responseText);
if (results) {
tabValues = eval(results);
var tabs = win.getComponent(0);
tabs.getComponent(0).update(tabValues[0]);
tabs.getComponent(1).update(tabValues[1]);
tabs.getComponent(2).update(tabValues[2]);
win.show(fld);
}
},
failure: function(e) { alert('Error loading field information!'); }
});
I came up so far with the help of ExtJs member "Animal" :-)
I searched for the documentation for updating tab's content using Ajax and the "update" function, but of no help. Please understand that the original requirement is bit complex and not required, but I must use this type of solution. :-)
Please advise. Thanks!
I am trying to update tab's content using Ajax and "update" function, but always get "tabs.getComponent(0).update is not a function" error. Here's the code:
var fldWinId = fld + "Window";
// Look up the button's Window and create it if it doesn't exist
var win = Ext.WindowMgr.get(fldWinId);
if (!win) {
win = new Ext.Window({
animateTarget: fld,
title: modeTitle,
width:680,
height:580,
minWidth:660,
minHeight:560,
closable: false,
closeAction: 'hide',
defaults:{autoHeight: true},
layout:'fit',
plain: modePlain,
items: {
xtype: 'tabpanel',
activeTab: 0,
items: [{
title: "Basic Info"
}, {
title: "Data Source"
}, {
title: "Data Display"
}]
},
buttons: [{
text: 'Close',
handler: function(){
win.hide();
}
}],
renderTo: Ext.getBody()
});
}
// Update the window's tab items.
Ext.Ajax.request({
url: modeUrl,
method: "GET",
success: function(e) {
var results = Ext.util.JSON.decode(e.responseText);
if (results) {
tabValues = eval(results);
var tabs = win.getComponent(0);
tabs.getComponent(0).update(tabValues[0]);
tabs.getComponent(1).update(tabValues[1]);
tabs.getComponent(2).update(tabValues[2]);
win.show(fld);
}
},
failure: function(e) { alert('Error loading field information!'); }
});
I came up so far with the help of ExtJs member "Animal" :-)
I searched for the documentation for updating tab's content using Ajax and the "update" function, but of no help. Please understand that the original requirement is bit complex and not required, but I must use this type of solution. :-)
Please advise. Thanks!