• 动态加载;toolbar


    第一种方式:直接传输事件绑定在里面   
    var aa = "[{text : '模板充值类',scope:this,handler:function(){this.inter_interface.onEditInter(306);}}]"; 
            var a = Ext.decode(aa);
            console.log(a);
            var scrollMenu = new Ext.menu.Menu();
            scrollMenu.add(a);
            this.toolbar = [{
                    id: 'addButton',
                    text: '添加接口',
                    iconCls: 'add',
                    scope: this,
                    menu : [
                    {
                        text : '模板添加',
                        scope: this,
                        menu :scrollMenu
    .......
    第二种方式:事件事后添加
            var aa = "[{text : '模板充值类',scope:this}]";
            var a = Ext.decode(aa);
            console.log(a);
            var scrollMenu = new Ext.menu.Menu();
            scrollMenu.add(a);
            var _this = this;
            scrollMenu.on('click', function(){_this.onEditInter(306);});
            this.toolbar = [{
                    id: 'addButton',
                    text: '添加接口',
                    iconCls: 'add',
                    scope: this,
                    menu : [
                    {
                        text : '模板添加',
                        scope: this,
                        menu :scrollMenu
     
    .......
    第三种方式:页面中加载 同步传输
    <script type="text/javascript" src="/public/js/ext/adapter/ext/ext-basex.js"></script>
     
     var rs ;
            Ext.Ajax.request({
                url : 'InterfaceMgr_1/menu_info',
                method: 'post',
                async : false,
                success: function( result, request ){
                     rs = Ext.decode(result.responseText);
                },
                failure: function( result, request){
                    Ext.MessageBox.alert('Failed', '获取信息失败');
                }
            });
     
    var scrollMenu = new Ext.menu.Menu();
            var _this = this;
            Ext.each(rs,function(result){
                var btn = new Ext.menu.Item({
                    text : result.name
                });
                btn.on('click',function(){
                    _this.onEditInter(result.id);
                });
                scrollMenu.add(btn);
            });
     
     
            this.toolbar = [{
                    id: 'addButton',
                    text: '添加接口',
                    iconCls: 'add',
                    scope: this,
                    menu : [
                    {
                        text : '模板添加',
                        scope: this,
                        menu :scrollMenu
     
     

    附件列表

    • 相关阅读:
      认识hasLayout——IE浏览器css bug的一大罪恶根源 转
      web网站p教程 转
      可遇不可求的Question之SQLServer的INSERT ON DUPLICATE KEY UPDATE语法篇
      可遇不可求的Question之Protoc.exe无法编译proto文件篇
      python各个版本的下载地址
      可遇不可求的Question之WCF发布无法运行篇
      [转]理解JSON:3分钟课程
      可遇不可求的Question之Silverlight发布IIS设置篇
      可遇不可求的Question之C#中的匿名事件导致内存泄露的解决篇
      可遇不可求的Question之mysql连接数暴增的解决方法篇
    • 原文地址:https://www.cnblogs.com/holyes/p/9543336cb7a86500e58cc7e8f9b5a4ce.html
    Copyright © 2020-2023  润新知