I cannot append searchPanes to two different tables using jquery using searchPanes.ontainer()

I cannot append searchPanes to two different tables using jquery using searchPanes.ontainer()

EvieEvie Posts: 7Questions: 2Answers: 0

I have two datatables, both have different search panes. But when i follow this example: "https://datatables.net/extensions/searchpanes/examples/customisation/verticalPanes.html" , to stack them vertically next to the table, they show on the first table and not the second table. I get this error: 'jQuery.Deferred exception: e is undefined'
The error is referrring to this line where I append the search panes to the second table: " $("div#tr_filters.dtsp-verticalPanes").append(tr_complete_table.searchPanes.container());"

Can someone help me figure this out? Thank you.

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • EvieEvie Posts: 7Questions: 2Answers: 0
    edited July 2021

    Thanks for the quick response @colin . Luckily I managed to figure it out. It was a self implemented bug. Thanks

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Glad all sortetd, thanks for reporting back,

    Colin

  • EvieEvie Posts: 7Questions: 2Answers: 0

    Hello @colin , I have another issue with the Datatables loading the searchpanes. The datatable contains data and it is displayed in the tables, but it still says 'No searchpanes'. could you help me figure out what i am missing?
    this is my js:

    var tr_table_all = $('#review_table_tr_complete').DataTable({
    "columnDefs": [
    {
    orderable: false, targets: "no-sort"
    },
    ],
    searchPanes: {
    layout: 'columns-1',
    columns: [1, 2, 8]
    },
    language: {
    searchPanes: {
    clearMessage: 'Alles Löschen',
    title: 'Aktive Filter - %d',
    }
    },
    dom: '<"dtsp-dataTable"rt>',
    pageLength: 20
    });
    tr_table_all.searchPanes();
    $('#review_table_tr_complete').DataTable().searchPanes.rebuildPane();
    $("#tr_filters").append(tr_table_all.searchPanes.container());

  • sandysandy Posts: 913Questions: 0Answers: 236
    Answer ✓

    Hi @Evie ,

    I'd say most likely the data isn't passing the check that SearchPanes does within searchPanes.threshold. I'd suggest trying to force the SearchPanes to show by using columns.searchPanes.show.

    If that still doesn't work we will need to see a test case as colin pointed out above.

    All the best,
    Sandy

  • EvieEvie Posts: 7Questions: 2Answers: 0

    @sandy Thank you very much, your suggestion was of great help. I used https://datatables.net/reference/option/columns.searchPanes.show , and now they are showing.

Sign In or Register to comment.