KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Datatables change excel export button to font-awesome excel icon #1754

Closed ankit raj opened this topic on on Dec 9, 2020 - 2 comments

ankit raj commented on Dec 9, 2020

Hi , i have a data table with an excel button at top and i want to convert it into font awesome excel icon . How do i achieve it? Right now i am using buttons as:

 "options"=>array(
                    "order" => [],
                    "bInfo" => false,
                    "dom" => 'Bfrtip',
                    "buttons" => [
                         'excel'
                    ],
Sebastian Morales commented on Dec 10, 2020

Ankit, pls check the guide from this DataTables' example:

https://datatables.net/extensions/buttons/examples/styling/icons.html

Certainly you would have to change the json setting to php array.

ankit raj commented on Dec 10, 2020

Perfect , this worked perfectly:

 "buttons" => [
                     array(
                        'extend'=>'excelHtml5',
                        'text'=>'<i class="fa fa-file-excel-o"></i>',
                         'titleAttr'=>'Excel'
                     )
                ],

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed

DataGrid