EXT 链接问题 求解答

sangyixian 2011-04-26 02:47:03
我的问题是多个链接点击进入同一个页面(如:点击aa、bb、cc进出新窗口A)但是页面A的标题要随(aa、bb、cc)链接的标题改动然后再点击新的窗口A中的一个新建button进入新页面,页面要和aa、bb、cc的ID判断的(就是说点击aa的A页面的新建后要打开和aa相关的页面)有点罗嗦了,请大家帮忙
下面是代码:

导航条如下:

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();
}
});


...全文
45 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复

52,797

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Ajax
社区管理员
  • Ajax
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧