首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2EE开发 >

不同Extjs页面之间 控件的调用有关问题

2012-02-17 
不同Extjs页面之间 控件的调用问题一个Js页面BtnToolBar.js 此页面是给toolbar自动加载按钮控件,通过BtnTo

不同Extjs页面之间 控件的调用问题
一个Js页面 BtnToolBar.js 此页面是给toolbar自动加载按钮控件,通过BtnToolBar.jsp获取相关按钮信息

JScript code
MES= {version : '0.1'};Ext.Toolbar.prototype.hiddenAllItems = function() {    this.items.each(function(item) {        if (item.hide) {            item.hide();        }    });};MES.BtnToolBar=function(obj, tree){    this.toolbar = obj;    if (this.toolbar) {        Ext.Ajax.request({            url : '/mis/wlcsp/rbac/BtnToolBar.jsp?DbType=check',            success : function(response, options) {                var responseArray = Ext.util.JSON.decode(response.responseText);                if (responseArray.success) {                    obj.hiddenAllItems();                    var strs= new Array(); //定义一数组                    strs=responseArray.BtnName.split(',');//按钮数组                    for(var i=0;i<strs.length;i++){                        var strstemp= new Array(); //定义一数组                        strstemp=strs[i].split(".");//每个数组中对应的多个信息                        //加载按钮                        LoadBtn(strstemp[0],strstemp[1]);                    }                }else{                    obj.hiddenAllItems();                }            }        });    }    //加载按钮方法    var LoadBtn = function(btnid,btnname) {        obj.add(new Ext.Button({            id:btnid,            text:btnname,            listeners:{click:BtnClick}        }));    };    var BtnClick = function(obj, e) {        obj.getId();    };};


另一个Js页面CustomerpoList.js,里面有一个方法
JScript code
function SearchCustomerpoOp(){    dsCustomerpoList.proxy = new Ext.data.HttpProxy({          url:'CustomerpoListData.jsp?DbType=GetCustomerpo&CustomerID='+Ext.getCmp("txt_customername_customerposearch_id").getValue()+'&CustPO='+Ext.getCmp("txt_custpo_customerposearch_id").getValue()    });   dsCustomerpoList.load({params : {start : 0,limit : 30}});}


在main.js中有如下部分代码
var logInOut = new WLCSP.BtnToolBar(LoginTitleBar, tree);
 var viewport = new Ext.Viewport({
  layout : 'border',// 布局方式,'border'
  items : [LoginTitleBar,StatusStrip,LeftMenu,MainTabPanel]
  });

我需要点击LoginTitleBar上的按钮,然后可以获取CustomerpoList.js页面中的方法


需要注意的,他们这几个页面都不在一起,是分布在多个文件夹下

[解决办法]
在首页index.jsp页面把js文件文件引用进来就可以调用了

热点排行