Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
1.7 kB
4
Indexable
Never
add_action('marketking_dashboard_head', function(){
    ?>
    <script>
        jQuery(document).ready(function(){
            setTimeout(function(){
                $('#marketking_dashboard_earnings_table').DataTable().destroy();
                var buttonclass = 'btn btn-sm btn-gray';
                var buttonclassedit = marketking_display_settings.edit_columns_class;

                var table = $('#marketking_dashboard_earnings_table').DataTable({
                    "language": {
                        "url": marketking_display_settings.datatables_folder+marketking_display_settings.tables_language_option+'.json'
                    },
                    oLanguage: {
                        sSearch: ""
                    },
                    columnDefs: [
                        { targets: [7], visible: true}
                      ],
                    dom: 'Bfrtip',
                    order: [[ 1, "desc" ]],
                    stateSave: false,
                    buttons: {
                        buttons: [
                            { extend: 'csvHtml5', className: buttonclass, text: '↓ CSV', exportOptions: { columns: ":visible" } },
                            { extend: 'pdfHtml5', className: buttonclass, text: '↓ PDF', exportOptions: { columns: ":visible" } },
                            { extend: 'print', className: buttonclass, text: marketking_display_settings.print, exportOptions: { columns: ":visible" } },
                            { extend: 'colvis', className: buttonclassedit, text: marketking_display_settings.edit_columns },
                        ]
                    }
                });
            }, 50);
        });
    </script>
    <?php
});
Leave a Comment