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);
                    }
                }
  • 相关阅读:
    HDU 4975 A simple Gaussian elimination problem.
    HDU 4888 Redraw Beautiful Drawings
    ZOJ 3795 Grouping
    HDU 4971 A simple brute force problem.
    ERROR: unable to bind listening socket for address ’127
    linux命令
    有关nginx的配置文件 之server
    CentOS LNMP环境搭建 各版本
    PHP扩展安装方法
    Nginx如何配置虚拟主机?
  • 原文地址:https://www.cnblogs.com/pricks/p/1815635.html
Copyright © 2011-2022 走看看