简体   繁体   English

FancyTree如何仅链接一部分节点

[英]FancyTree how to link just a portion of the node

I've just come across this: I've got a list of nodes showing data in a table: 我刚刚遇到了这个问题:我有一个在表中显示数据的节点列表:

Column A, Column B, Column C 列A,列B,列C

I set an action when you click the node, checking the type of the node: 单击节点时,我设置了一个动作,检查节点的类型:

 activate: function(event, data) { if (data.node.isFolder()) { return false; } if (data.node.data.datatype) { //doSomething; } else if (data.node.data.datatype2) { //doSomething; } else { //doSomething; } return false; } 

Is there any easy way to, for example, do something (es. go to a link or .do) in column A but another link in column B on the same node? 是否有任何简单的方法,例如,在同一节点上的A列中执行某些操作(例如,转到链接或.do),但在B列中执行其他操作?

You could try to inspect the target of the data.originalEvent , for example 您可以尝试检查data.originalEvent的目标,例如

activate: function(event, data) {
  if ( $(data.originalEvent.target).hasClass("...") {
    return false;
  }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM