zoukankan      html  css  js  c++  java
  • EXTJS treeClick(node, e)

      在EXT框架中,为目录树节点添加点击事件,需要注意点击节点时的目标页的打开方式:

      1:通过HTML打开

      2:通过TabPanel的autoLoad方式加载

      第二种方式比第一种方式性能高,但若节点链接到外部,例如http://www.baidu.com,则只能使用第一种方式。

      以下是示例:

      

                       //设置树的点击事件
               function treeClick(node, e) {
                   
    if (node.isLeaf()) {
                        e.stopEvent();
                       
    var n = center_panel.getComponent(node.id);
                       
    if (!n) {
                           
    var n = center_panel.add({
                                       
    'id' : node.id,
                                       
    'title' : node.text,
                                        closable :
    true,
    //                                    autoLoad : {
    //
                                            url :node.attributes.href,
    //
                                            scripts :true
    //
                                        }//通过autoLoad属性载入目标页,如果要用到脚本,必须加上scripts属性
                                        html : '<iframe id="center- iframe" width="100%" height=100% name="main" src="' + 
                                            node.attributes.href
    +'" mce_src="'+node.attributes.href + 
                                            
    '"  frameborder="0" scrolling="auto" style="border:0px none; background- color:#BBBBBB;" mce_style="border:0px none; background-color:#BBBBBB;"& gt;</iframe>'// 通过html载入目标页 
                                    });
                        }
                        center_panel.setActiveTab(n);
                    }
                }
  • 相关阅读:
    反射,Expression Tree,IL Emit 属性操作对比
    vue2.0 创建项目
    vue-cli3.0 Typescript 项目集成环信WebIM 群组聊天
    vue-property-decorator vue typescript写法
    TypeScript中是使用强类型函数作为参数
    应用监控与管理Actuator
    ES数据库下载安装
    删除SDE用户报ORA-00604 ORA-21700
    ArcGIS中的WKID
    改变您的HTTP服务器的缺省banner
  • 原文地址:https://www.cnblogs.com/pricks/p/1815635.html
Copyright © 2011-2022 走看看