0

Jquery ダイアログ ボックスで Fancy Tree によって変換されたリストをレンダリングします。サブノードを選択してツリーを閉じると、その親ノードが展開解除され、ダイアログボックスが閉じられることに気付きました。別のノードをクリックしてダイアログ ボックスを再度開くと、選択した他のノードが自動的に展開されてから展開解除されることがわかります。

$("#errorCodes").fancytree({
    activeVisible: false, // Make sure, active nodes are visible (expanded).
    aria: false, // Enable WAI-ARIA support.
    autoActivate: false, // Automatically activate a node when it is focused (using keys).
    autoCollapse: false, // Automatically collapse all siblings, when a node is expanded.
    autoScroll: false, // Automatically scroll nodes into visible area.
    clickFolderMode: 3, // 1:activate, 2:expand, 3:activate and expand, 4:activate (dblclick expands)
    checkbox: false, // Show checkboxes.
    debugLevel: 0, // 0:quiet, 1:normal, 2:debug
    disabled: false, // Disable control
    generateIds: false, // Generate id attributes like <span id='fancytree-id-KEY'>
    idPrefix: "ft_", // Used to generate node id´s like <span id='fancytree-id-<key>'>.
    icons: false, // Display node icons.
    keyboard: true, // Support keyboard navigation.
    keyPathSeparator: "/", // Used by node.getKeyPath() and tree.loadKeyPath().
    minExpandLevel: 1, // 1: root node is not collapsible
    selectMode: 1, // 1:single, 2:multi, 3:multi-hier
    tabbable: false, // Whole tree behaves as one single control
    titlesTabbable: false // Node titles can receive keyboard focus
});
errorTree = $("#errorCodes").fancytree("getTree");

$("input[name=searchErrors]").keyup(function (e) {
    var match = $(this).val();
    if (e && e.which === $.ui.keyCode.ESCAPE || $.trim(match) === "") {
        $("button#btnResetSearchErrors").click();
        return;
    }

    var n = errorTree.applyFilter(match);
    $("button#btnResetSearchErrors").attr("disabled", false);
    $("span#matchesErrors").text("(" + n + " Results)");
}).focus();

$("button#btnResetSearchErrors").click(function (e) {
    $("input[name=searchErrors]").val("");
    $("span#matchesErrors").text("");
    errorTree.clearFilter();
}).attr("disabled", true);

$("input#hideModeErrors").change(function (e) {
    errorTree.options.filter.mode = $(this).is(":checked") ? "hide" : "dimm";
    errorTree.clearFilter();
    $("input[name=searchErrors]").keyup();
});
4

1 に答える 1

0

FancyTree の最新バージョン 2.3.0 をダウンロードして、この問題を解決しました。問題は、ノードをクリックしてチェックを使用すると、アクティブな行になっていたことでした。そのため、別のルート ノードを展開すると、アクティブな行があったノードが自動的に展開されていました。

于 2014-08-24T01:26:08.127 に答える