SearchPanes Button: init issue ?

SearchPanes Button: init issue ?

martinxmuellermartinxmueller Posts: 8Questions: 1Answers: 0
edited April 2020 in Free community support

I use SearchPanes Button. Could it be, that the SearchPanes initialization parameters are not evaluated?
Within the init function, i have added the variable 'opts':

$.fn.dataTable.ext.buttons.searchPanes = {
            text: 'Search Panes',
            init: function (dt, node, config) {
                var opts = {};
                if (dt.init().searchPanes && dt.init().searchPanes.dtOpts)
                   opts = dt.init().searchPanes.dtOpts;**
                var panes = new $.fn.dataTable.SearchPanes(dt, {
                    dtOpts: opts,
                    filterChanged: function (count) {
                        dt.button(node).text(dt.i18n('searchPanes.collapse', { 0: 'SearchPanes', _: 'SearchPanes (%d)' }, count));
                    }
                });

Answers

  • sandysandy Posts: 913Questions: 0Answers: 236

    Hi @martinxmueller ,

    Would you mind creating a test case for this please so that we can see exactly what your problem is? 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.

    Thanks,
    Sandy

  • martinxmuellermartinxmueller Posts: 8Questions: 1Answers: 0

    Hi,
    in the nightly file from SearchPanes (2020-04-19), the problem is solved. You can define SearchPanes initial parameters within the button definition:

    buttons:[
    {
    extend: 'searchPanes',
    config: { threshold: 0.7, dtOpts: { pageLength: 250 } }
    },
    'searchPanesClear'
    ]

This discussion has been closed.