1

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

我试图return false在它设置时放置listener

...
listeners : {
    click : function (node) {
        /* some processes */

        return false;
    }
}
...

似乎它没用,锚仍在触发它的href。

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

有任何想法吗?

4

1 回答 1

1

I can't do onClick injection for all nodes, because the nodes are loaded on demand.

Not necessarily, have you thought about doing this with a different approach, i.e.:

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
});
于 2010-11-03T11:28:14.007 回答