PDA

View Full Version : History Problem



6 Jun 2014, 6:27 AM
Gurus,

I am newbie ExtJS. I have below two methods and want display in a two sub-tabs.


Method 1:
-------------

viewRoles: function(grid, record) {
if(!record || !record.data){
record = globalVars.selectedFarmRecord;
}
var me = this;
var p = Ext.getCmp("farmrolesview_"+record.data.id);
if (p !== undefined) {
p.ownerCt.setActiveTab(p);
} else {

this.getIpcloudContext().addHistory("farms/"+record.data.id+"/viewroles", Ext.widget("farmrolelist", {
id:"farmrolesview_"+record.data.id,
title:"" + record.data.name+" => " + i18n._safemsg("ipcenter.ipcloud.roles")/*,
listeners: {
render:function(panel) {
me.loadForm(panel, record.data.id);
}.bind(this)
}*/
}));
}
},


Method 2:
--------------

viewServers: function(grid, record) {
if(!record || !record.data){
record = globalVars.selectedFarmRecord;
}
var me = this;
var p = Ext.getCmp("farmserversview_"+record.data.id);
if (p !== undefined) {
p.ownerCt.setActiveTab(p);
} else {

this.getIpcloudContext().addHistory("farms/"+record.data.id+"/viewservers", Ext.widget("farmserverlist", {
//id:"farmserversview_"+record.data.id,
//title:"" + record.data.name+" => " + i18n._safemsg("ipcenter.ipcloud.servers")
}));
}
},


Please help me out.

Gary Schlosberg
13 Jun 2014, 3:36 PM
Here's the doc page for tab panel:
http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.tab.Panel

You can throw the example into a Fiddle, get your code working there, and post a link so we can see what the issue is.
https://fiddle.sencha.com/#home