代码之家  ›  专栏  ›  技术社区  ›  Jeaf Gilbert

阻止ExtJS树节点锚启动,但没有哈希

  •  1
  • Jeaf Gilbert  · 技术社区  · 14 年前

    我需要防止树节点锚定导航当前页面,但锚定必须保持显示其链接(无哈希)。

    return false 当它设置 listener :

    ...
    listeners : {
        click : function (node) {
            /* some processes */
    
            return false;
        }
    }
    ...
    

    我不能对所有节点执行onClick注入,因为节点是按需加载的。

    有什么想法吗?

    1 回复  |  直到 14 年前
        1
  •  1
  •   SW4    14 年前

    我不能一次注射 节点,因为节点加载在

    不一定,你有没有想过用另一种方法,即:

    YOURTREEPANELCOMPONENT.on('click',function(currentnode, clickevent){
       // prevent href from being called and the page from loading
       clickevent.stopEvent();
       // what else to do when the node is clicked
    });