SearchPanes 0.0.1 to 2.3.3 upgrade issue (DataTables 1.13.11)

SearchPanes 0.0.1 to 2.3.3 upgrade issue (DataTables 1.13.11)

LeighLeigh Posts: 22Questions: 2Answers: 0
edited December 9 in Free community support

We've been happily using SearchPanes 0.0.1 for a number of years now, but we want to catch up to the 1.0.0 release.

This block of code no longer works:

            searchPane: {
                threshold: 0,
                columns: filterableIndexesArray,
                container: '#subFilters' + index + ' div.panel-body'
            }

Can anyone point me to the 1.0.0 way of achieving this/help me to rework it? I've scoured the help, but nothing has worked so far. The panes were positioned outside of the DataTable, and there can be multiple datatables per page.

The following (work-around?) worked for re-positioning the panels, but it won't work for multiple datatables:

$('#subFilters' + index + ' div.panel-body').append($('.dtsp-panesContainer'));

I appreciate any help offered, as I've spent way too long on this already.

Thanks

Answers

  • kthorngrenkthorngren Posts: 21,443Questions: 26Answers: 4,974

    Possibly this example will help. Maybe use initComplete to place the SearchPanes container. For example:

    initComplete: function () {
      var api = this.api();
      api.searchPanes.container().prependTo( '#subFilters' + index + ' div.panel-body' );
    }
    

    You may need to adjust the code for your specific environment. For example, I'm not sure what index is and where it is set in relation to the Datatable initialization.

    If you need help with this then please build a simple example that replicates a couple Datatables so we can provide more specific suggestions based on your environment.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • kthorngrenkthorngren Posts: 21,443Questions: 26Answers: 4,974
    edited December 9

    I'm not sure what SearchPanes 0.0.1 used for the SearchPanes config option but its searchPanes not searchPane as you have above. Note the trailing s.

    Kevin

  • allanallan Posts: 63,676Questions: 1Answers: 10,497 Site admin

    Looking back at the old blog post I think it was searchPane and it was updated when it was more robustly implemented.

    Allan

  • LeighLeigh Posts: 22Questions: 2Answers: 0

    Thanks all, I managed to get everything up and running again. The later 2.3.x release do seem to have a number of issues, though. I'll find time to raise them asap.

Sign In or Register to comment.