PDA

View Full Version : How to update panel data



amanind
8 Dec 2011, 6:02 AM
I have a panel and I am display some content in it. Under the panel I have a button, on click of button I want to change load data from other method.

here is the code




MainContentPanel = Ext.extend(Ext.Panel, {
initComponent: function() {
var termCon = new termsConditions();

var config = {
xtype: 'Panel',
// width: 'auto',
id:'mainPanel',
height:'100%',
frame:false,
items:[{
id: 'termCondId',
items:[ termCon ]
}]
};
Ext.apply(this, Ext.apply(this.initialConfig, config));
MainContentPanel.superclass.initComponent.apply(this, arguments);
appEventManager.on("acceptCondition", this.loadData, this);
},
loadData: function() {
var leftdata = new leftPanel();
Ext.getCmp('termCondId').remove();
Ext.getCmp('termCondId').add(leftdata);
},
onDestroy: function() {
appEventManager.un("acceptCondition", this.loadData, this);
}
});

mitchellsimoens
9 Dec 2011, 11:29 AM
http://docs.sencha.com/ext-js/3-4/#!/api/Ext.Panel-method-update