dataTables export button display in custom position?

后端 未结 2 1323
情深已故
情深已故 2020-12-16 06:56

I want to show my dataTable export button in custom div . how can I Do this ?

my Current code

this is default code and buttons show seperatly on top of my

2条回答
  •  误落风尘
    2020-12-16 07:54

    I was looking for something similar i.e. rendering the buttons in drop-down. The easiest solution was to use datatable's collection button option.

     buttons: [
                {
                    extend: 'collection',
                    text: 'Export',
                    buttons: [
                        'copy',
                        'excel',
                        'csv',
                        'pdf',
                        'print'
                    ]
                }
            ]
    

    Ref: https://editor.datatables.net/examples/extensions/exportButtons.html

    Hope this might help someone.

    Thanks!

提交回复
热议问题