Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
html表中使用的TreeTable jQuery插件_Jquery_Jquery Plugins - Fatal编程技术网

html表中使用的TreeTable jQuery插件

html表中使用的TreeTable jQuery插件,jquery,jquery-plugins,Jquery,Jquery Plugins,我在html表中使用treeTable jquery插件()时遇到问题。看起来,如果我尝试拖放项目,我的表就会消失。我的树表在另一个html表中 i、 e 看起来它将所有的父TR设置为可拖放 示例4.3(在插件文档中)与我使用的非常类似,但在另一个html表/tr.中,您可以始终使用us$(“#tableId”).Find(“.specificRow”)深入到表中的特定项。您可能必须这样做才能确定您希望treeTable插件访问的特定表 祝你好运,希望这会有所帮助。事实上,我刚刚解决了这个问题

我在html表中使用treeTable jquery插件()时遇到问题。看起来,如果我尝试拖放项目,我的表就会消失。我的树表在另一个html表中

i、 e

看起来它将所有的父TR设置为可拖放

示例4.3(在插件文档中)与我使用的非常类似,但在另一个html表/tr.

中,您可以始终使用us$(“#tableId”).Find(“.specificRow”)深入到表中的特定项。您可能必须这样做才能确定您希望treeTable插件访问的特定表


祝你好运,希望这会有所帮助。

事实上,我刚刚解决了这个问题

我意识到在我使用的树型代码中,它使用的是“parents”函数,因为上面有tr,所以它假设它们是可删除的。我为tr添加了一个not(.IgnoreforDropable)(如下所示)以忽略树表之外的tr(并将类IgnoreforDropable添加到这些tr中)。这样,这些tr将无法丢弃

// Configure droppable rows
$("#dnd-example .folder").each(function() {
  $(this).parents("tr:not(.ignoreForDroppable)")).droppable({
    accept: ".file, .folder",
    drop: function(e, ui) { 
      // Call jQuery treeTable plugin to move the branch
      $($(ui.draggable).parents("tr:not(.ignoreForDroppable)")).appendBranchTo(this);
    },
    hoverClass: "accept",
    over: function(e, ui) {
      // Make the droppable branch expand when a draggable node is moved over it.
      if(this.id != $(ui.draggable.parents("tr")[0]).id && !$(this).is(".expanded")) {
        $(this).expand();
      }
    }
  });
});

这可能会奏效——但我认为,因为它是一个表中的一个表——代码使用的是parents方法——它似乎一直在表中“向上”和“向上”——我认为我需要忽略树表之外的tr。谢谢你的快速回复。