DataTables / Buttons

Buttons is an extension for DataTables that adds control buttons to the table.
Other
137 stars 149 forks source link

Fix prefix/postfix buttons disappearing when colReorder is also used #190

Open demetris-manikas opened 2 years ago

demetris-manikas commented 2 years ago

Hi.

I use both the colVis and colReorder plugins and I noticed that if a column has been moved then all prefix/postfix buttons that I have defined along with the colvis button vanish.

Here is the definition I use

var button = {
        extend: 'colvis',
        text: 'Reset',
        columns: ':not(.colvis-ignore)',
        postfixButtons: [
            {
               extend: 'colvisRestore',
            }
        ]
    }

This PR addresses this issue. Please let me know whether I should setup a showcase for this. Thanks a lot for your time.

AllanJard commented 2 years ago

Many thanks for this! I'll review it properly before the next Buttons release. Are you happy for this to be included under the MIT license?

demetris-manikas commented 2 years ago

Yes of course I am.

demetris-manikas commented 2 years ago

I have also created an almost identical to colVis extension (renames mostly) for manipulating the searchable property. Would you be interested in that as well?