kresnandya
30 Nov 2007, 9:15 AM
Hi
my question is : is it possible to load multiple tabs in just one click ?
this is my code :
in sample.js
desktop.mj = Ext.extend(Ext.app.Module, {
id : 'mj-win',
init : function() {
this.launcher = {
text : 'test',
iconCls : 'icon-grid',
handler : this.createWindow,
scope : this
}
},
createWindow : window.createMj
});
window constructor
function createMj() {
var desktop = this.app.getDesktop();
var win = desktop.getWindow('mj-win');
// create tree
tree = new Ext.tree.TreePanel( {
animate : true,
enableDD : true,
containerScroll : true,
region : 'west',
margins : '3 0 3 3',
cmargins : '3 3 3 3'
});
root = new Ext.tree.TreeNode({text : 'Semua', allowDrag : false, allowDrop : false});
root.addListener("click", testLoad, this);
tree.setRootNode(root);
// create tab panel
pan = new Ext.TabPanel( {
defaults:{autoScroll:true},
region : 'center',
activeTab : 0,
items : [{
title: 'tab 1',
items: mainPanel = new Ext.Panel({
autoScroll : true,
margins : '3 3 3 0'
})
},{
title: 'tab 2',
items: detPanel = new Ext.Panel({
autoScroll : true,
margins : '3 3 3 0',
})
}]
})
if (!win) {
win = desktop.createWindow( {
id : 'mj-win',
width : 860,
height : 500,
layout : 'border',
items : [tree, pan]
});
}
win.show();
}
function for load panel
function testLoad() {
mainPanel.load({url : 'pages/mnj/Project.htm'});
detPanel.load({url : 'pages/mnj/Detail.htm'});
}
and the result is error : this.body has no properties
i also try to use listeners in second tab : listeners: {activate: loadDetail}:
functions for listeners :
function loadDetail() {
detPanel.load({url : 'pages/mnj/detail.htm'});
}
and the result is error : detPanel has no properties
im confused... please help me thx
my question is : is it possible to load multiple tabs in just one click ?
this is my code :
in sample.js
desktop.mj = Ext.extend(Ext.app.Module, {
id : 'mj-win',
init : function() {
this.launcher = {
text : 'test',
iconCls : 'icon-grid',
handler : this.createWindow,
scope : this
}
},
createWindow : window.createMj
});
window constructor
function createMj() {
var desktop = this.app.getDesktop();
var win = desktop.getWindow('mj-win');
// create tree
tree = new Ext.tree.TreePanel( {
animate : true,
enableDD : true,
containerScroll : true,
region : 'west',
margins : '3 0 3 3',
cmargins : '3 3 3 3'
});
root = new Ext.tree.TreeNode({text : 'Semua', allowDrag : false, allowDrop : false});
root.addListener("click", testLoad, this);
tree.setRootNode(root);
// create tab panel
pan = new Ext.TabPanel( {
defaults:{autoScroll:true},
region : 'center',
activeTab : 0,
items : [{
title: 'tab 1',
items: mainPanel = new Ext.Panel({
autoScroll : true,
margins : '3 3 3 0'
})
},{
title: 'tab 2',
items: detPanel = new Ext.Panel({
autoScroll : true,
margins : '3 3 3 0',
})
}]
})
if (!win) {
win = desktop.createWindow( {
id : 'mj-win',
width : 860,
height : 500,
layout : 'border',
items : [tree, pan]
});
}
win.show();
}
function for load panel
function testLoad() {
mainPanel.load({url : 'pages/mnj/Project.htm'});
detPanel.load({url : 'pages/mnj/Detail.htm'});
}
and the result is error : this.body has no properties
i also try to use listeners in second tab : listeners: {activate: loadDetail}:
functions for listeners :
function loadDetail() {
detPanel.load({url : 'pages/mnj/detail.htm'});
}
and the result is error : detPanel has no properties
im confused... please help me thx