Column Control appears two times

Column Control appears two times

siXelsiXel Posts: 2Questions: 1Answers: 0

Hello,

I'm not new to DataTables.

But recently in a small project I wanted to use Column Control plugin. Everything works perfectly except that those controls are appear two times per column.

Any hints how to debug ?

Maybe something is called twice ? But could not figure it out yet. It is simple php file (twig Templates) which loads 4 rows from the database.

new DataTable("#test-table",{
    paging: true,
    searching: false,
    columnControl: ['order', 'colVisDropdown',['searchList']],
    ordering: {
        indicators: false
    }
});

Answers

  • kthorngrenkthorngren Posts: 22,325Questions: 26Answers: 5,134

    Your code snippet works as expected in this test case:
    https://live.datatables.net/jepilupa/1/edit

    Can you provide a link to your page or a test case replicating the issue so we can help debug?
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    You have searching: false, which will disable the searching capability of the Datatable including ColumnControl. Use the layout option to remove the global search input and leave the search option set to true to keep the searching capability.

    Kevin

  • siXelsiXel Posts: 2Questions: 1Answers: 0

    Hello,

    thx !

    After check my code again completly with live.datatables.net ... I sadly found out that I accidently loaded a Datatables with a Column Control included and I load it again as external plugin. That makes 2 appearances in the column header.

    thx again !
    Erik

  • allanallan Posts: 65,339Questions: 1Answers: 10,838 Site admin

    Oh - that is interesting! I'll take a look and see if I can prevent that.

    Allan

Sign In or Register to comment.