extjs 页面的交互问题 index.jsp 页面里面有一个 tabPanel组件 其中包含了一个含有GridPanel的 myshop_grid.jsp页面,现在我想 点击 GridPanel 后 可以调用 index.jsp 里面的tabPanel 增加一个页面 有办法做到吗? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 myshop_grid.jsp 在 index.jsp中 ?你用了iframe? var tabPanel = new Ext.TabPanel( { region : 'center', enableTabScroll : true, deferredRender : false, activeTab : 0, items : { id: "index", title : 'index', autoLoad :{url:'http://localhost:8080/myboxcn_cs/admin/MyJsp.jsp?shopLocationid=0',scripts:true}, closable : 'true' } }); 这样写会跨域,用iframe就不会了,如果在本地就无所谓了。子窗体访问父窗体用parent.函数名();//函数在index.jsp中写好。 http://www.javaeye.com/topic/265347//子窗体访问父窗体 直接增加一个tab即可,在index.jsp页面添加一个方法addTabfunction addTab(strTitle,url) {tabs.add({ title: strTitle, html: '<iframe frameborder=\"0\" style=\"overflow:auto; width:100%; height:100%;border:0px;\" src=\"'+url+'\"></iframe>', closable:true }).show();}在myshop_grid.jsp页面也就是在GridPanel中添加tab,调用window.parent.addTab("tab", "a.jsp");因为GridPanel是tabPanel的一个tab的组件,故可以调用window.parent.addTab即调用父页面的方法 上面的方法是没有用的我刚刚在index.jsp 页面里添加如下函数var addPanel = function(event) { Ext.Msg.alert('ext','welcome you!'); } 在myshop_grid.jsp 页面里面 使用 window.parent.addPanel(); 是访问不到的 我刚刚尝试了 使用 你所说的方法 这样添加了一个页面进来{ id:"index2", title:'index2', html: ' <iframe scrolling="auto" frameborder="0" width="100%" height="100%" src="test.jsp"> </iframe>', }但是依旧不能够访问到 index.jsp页面内的函数 parent.Ext.getCmp('tabp').add({ id: "index3", title : "index3", autoLoad :{url:'http://localhost:8080/myboxcn_cs/MyJsp.jsp?shopLocationid=0',scripts:true}, closable : 'true', });tabp 为 tabPanel 的 id Jquery获取到div中checkbox中每一组的数量 关于ExtJS的求助 手动事件 梅花雨大人.请教一个关于树形控件问题. 谁有用过javascript来做RSA加密的?进来看看 双网卡服务器怎样用JavaScript检测访问者的速度或ip并跳转到速度快的端口? mailto 中的 bcc不起作用 改变属性的问题? 如何让网页的表格等东西消失? 本人不懂JS,求JS大神帮忙解决一个问题 用户名检验,繁简转换问题 jquery验证所有textbox的值
var tabPanel = new Ext.TabPanel( {
region : 'center',
enableTabScroll : true,
deferredRender : false,
activeTab : 0,
items : {
id: "index",
title : 'index',
autoLoad :{url:'http://localhost:8080/myboxcn_cs/admin/MyJsp.jsp?shopLocationid=0',scripts:true},
closable : 'true'
}
});
子窗体访问父窗体用parent.函数名();//函数在index.jsp中写好。
function addTab(strTitle,url) {
tabs.add({
title: strTitle,
html: '<iframe frameborder=\"0\" style=\"overflow:auto; width:100%; height:100%;border:0px;\" src=\"'+url+'\"></iframe>',
closable:true
}).show();
}
在myshop_grid.jsp页面也就是在GridPanel中添加tab,调用window.parent.addTab("tab", "a.jsp");
因为GridPanel是tabPanel的一个tab的组件,故可以调用window.parent.addTab即调用父页面的方法
我刚刚在index.jsp 页面里添加如下函数var addPanel = function(event) {
Ext.Msg.alert('ext','welcome you!');
}
在myshop_grid.jsp 页面里面
使用 window.parent.addPanel(); 是访问不到的
我刚刚尝试了 使用 你所说的方法
这样添加了一个页面进来{
id:"index2",
title:'index2',
html: ' <iframe scrolling="auto" frameborder="0" width="100%" height="100%" src="test.jsp"> </iframe>',
}但是依旧不能够访问到 index.jsp页面内的函数
id: "index3",
title : "index3",
autoLoad :{url:'http://localhost:8080/myboxcn_cs/MyJsp.jsp?shopLocationid=0',scripts:true},
closable : 'true',
});tabp 为 tabPanel 的 id