CascadePanes not working for me

CascadePanes not working for me

rdmrdm Posts: 194Questions: 55Answers: 4

I'm looking at https://datatables.net/reference/option/searchPanes.cascadePanes, but I can't seem to get it to work. Or maybe I'm not understanding what that feature is supposed to do.

I was under the impression that if I made a selection in one pane, the others would automagically refresh to list only the remaining options in the table being filtered. The manual says that all I need to is add "cascadePanes: true" but it's not doing anything that I can see.

Is there something I'm missing?

"use strict";
var OwProgressController = function () {
    const init = function () {
        const contentTable = $("#ContentTable").DataTable({
            dom: "PlBfiprt",
            buttons: ["excelHtml5", "print"],
            searchPanes: {
                initCollapsed: true,
                columns: [1, 3, 4, 7],
                cascadePanes: true
            }
        });
    };
    return { init: init }
}();

Answers

  • allanallan Posts: 63,482Questions: 1Answers: 10,467 Site admin

    I was under the impression that if I made a selection in one pane, the others would automagically refresh to list only the remaining options in the table being filtered

    Yes, which can be seen in this example.

    If it isn't working for you, please link to a test case showing the issue.

    Allan

  • rdmrdm Posts: 194Questions: 55Answers: 4

    I went to jsFiddle and everything worked fine... so long as I hard coded my table values in the HTML. I use .NET MVC without AJAX -- all the table is loaded on page rendering. That's not an environment I can simply post on jsFiddle. So it looks like I have to dig into why cascadePanes works in your environment and not mine.

  • rdmrdm Posts: 194Questions: 55Answers: 4

    AHA! This is what caused the cascadePanes to fail:

    columns: [1, 3, 4, 7]

    In my scenario, I need to show only certain panes, but then that causes the cascadePanes to fail.

  • allanallan Posts: 63,482Questions: 1Answers: 10,467 Site admin

    It seems to work okay if I try it here: https://live.datatables.net/hayokabo/1/edit .

    Allan

Sign In or Register to comment.