Column visibility button

Column visibility button

motharmothar Posts: 7Questions: 3Answers: 0

Hi,
How i can rename the Column visibility button into custom text like (Manage Column)

Thanks

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin

    Use the buttons.buttons.text option:

    new DataTable('#myTable', {
        layout: {
            topStart: {
                buttons: [
                    {
                        extend: 'colvis',
                        text: 'Manage Columns'
                    }
                ]
            }
        }
    });
    

    Allan

  • motharmothar Posts: 7Questions: 3Answers: 0

    Thanks

  • diedeerdiedeer Posts: 16Questions: 2Answers: 0

    Hi,
    How to do this for more than one Button?
    Datatables is very powerfull!
    Good job.
    Best regards

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin

    Just set the text option for each button you need:

    new DataTable('#myTable', {
        layout: {
            topStart: {
                buttons: [
                    {
                        extend: 'colvis',
                        text: 'Manage Columns'
                    },
                    {
                        extend: 'csv',
                        text: 'Export CSV'
                    }
                ]
            }
        }
    });
    

    Allan

  • diedeerdiedeer Posts: 16Questions: 2Answers: 0

    Thank you Allan.

Sign In or Register to comment.