我遇到過同樣的問題。它只出現在autoScroll:true和filter:{mode:「hide」}設置已設置。如果您可以在沒有這些設置的情況下離開,它可以正常工作
當計算節點的最後一個子節點的自動滾動時,NodeSetExpanded()方法出現問題。如果此子項與篩選條件不匹配,則它將被篩選隱藏,因此.is(「:visible」)斷言失敗。 我已經在FancytreeNode引入下面的方法在本地固定此:
getLastVisibleChild: function() {
var last = null;
if (this.children) {
for(var i=0, l=this.children.length; i<l; i++){
if ($(this.children[i].span).is(":visible")) {
last = this.children[i];
}
}
}
return last;
}
比我在nodeSetExpanded使用此方法()與
// Scroll down to last child, but keep current node visible
node.getLastVisibleChild().scrollIntoView(true, {topNode: node}).always(function(){
工作正常替換
// Scroll down to last child, but keep current node visible
node.getVisibleChild().scrollIntoView(true, {topNode: node}).always(function(){
。
我建議你在項目頁面上爲它打開一個問題 – mar10 2015-02-06 13:09:18
我已經打開了一個問題。 https://github.com/mar10/fancytree/issues/391 – 2015-02-06 14:47:22