52,797
社区成员
发帖
与我相关
我的任务
分享
var windowIndex = 0;
MyDesktop.BogusMenuModule = Ext.extend(MyDesktop.BogusModule, {
init: function () {
this.launcher = {
text: 'Bogus Submenu',
iconCls: 'bogus',
handler: function () {
return false;
},
menu: {
items: [{
id: 'Window ' + (++windowIndex),
text:'aa',
iconCls: 'bogus',
handler: this.createWindow,
scope: this,
windowId: windowIndex
}, {
id: 'Window ' + (++windowIndex),
text: 'bb',
iconCls: 'bogus',
handler: this.createWindow,
scope: this,
windowId: windowIndex
}, {
id: 'Window ' + (++windowIndex),
text: 'cc',
iconCls: 'bogus',
handler: this.createWindow,
scope: this,
windowId: windowIndex
}, {
id: 'Window ' + (++windowIndex),
text: 'dd',
iconCls: 'bogus',
handler: this.createWindow,
scope: this,
windowId: windowIndex
}, {
id: 'Window '+(++windowIndex),
text: 'ee',
iconCls: 'bogus',
handler: this.createWindow,
scope: this,
windowId: windowIndex
}]
}
}
}
});
//----点击按钮进入同一个页面但是标题不同如下:
MyDesktop.BogusModule = Ext.extend(Ext.app.Module, {
init: function () {
this.launcher = {
text: 'Window ' + (++windowIndex),
iconCls: 'bogus',
handler: this.createWindow,
scope: this,
windowId: windowIndex
}
},
//--------
//---点击新建弹出的窗口 wasiaWindow: function () {
var desktop = this.app.getDesktop();
var win = desktop.getWindow('aaaaa');
if (!win) {
win = desktop.createWindow({
id: 'aaaaa', title: '瓦斯抽采', iconCls: 'jihuaziji', width: 665, height: 510, plain: true, resizable: false, layout: 'border',
buttons: [
{ text: '保 存', height: 40, handler: function () { } },
{ text: '重 置', height: 40,
handler: function () {
Ext.getCmp('text1').setValue('');
}
}]
});
}
win.show();
},
//---结束
//--------
createWindow: function (src) {
var desktop = this.app.getDesktop();
var win = desktop.getWindow('bogus' + src.windowId);
if (!win) {
win = desktop.createWindow({
id: 'bogus' + src.windowId,
title: src.id,
width: 640,
height: 480,
tbar: { xtype: 'toolbar', height: 30,
items: [{
xtype: 'button',
text: '新建',
width: 60,
//问题是下面 怎样点击新建的时候进入不同的页面 ?我让他alert个值弹出对了 就是不弹出窗口 各位给看一下
handler: function () {
if (src.id == 'Window 1') {
//alert('1dao');
this.wasiaWindow;
} else if (src.id == 'Window 2') {
alert('2 dao');
} else if (src.id == 'Window 3') {
alert('3 dao');
} else if (src.id == 'Window 4') {
alert('4 dao');
} else if (src.id == 'Window 5') {
alert('5 dao');
}
}, scope: this
}]
}
});
}
win.show();
}
});