I am working on a project that uses the jQuery DataTables theme with privileges (Smart Admin). I find the tool an excellent client solution specifically for filtering results without returning to the server.
The fields of the table that we show are only part of what is in the database due to the lack of space. The problem is that the export function includes only these restricted columns. I am red if we have a hidden column that will also be exported (for example: csv, xls, pdf), etc.
I tried to raise the field, and it did not work for me. I will be obligated if you can point out what I am doing wrong.
I referenced the following article: Example Data Table - Hidden Columns
There were no console errors, but the rest of the functionality (filtering, exporting works well).
Be that as it may, my problem is that we may have an error, the latter has not been updated. I think we have v1.10.
# @fn setup: -> {{{ # @brief Sets up DataTable plugin with the help of the @$_tableId provided. setupDataTables: -> self = @ @setupCheckboxes() if @$_bulkControls.length > 0 @$_dataTables = $(@$_tables).dataTable "columnDefs": [ { "targets": [1, 2, 3, 4], "visible": false } ], "sDom": "<'dt-toolbar'<'col-xs-12 col-sm-6'f><'col-sm-6 col-xs-6 hidden-xs'T>r>t<'dt-toolbar-footer'<'col-sm-6 col-xs-12 hidden-xs'i><'col-sm-6 col-xs-12'p>>" "oTableTools": { "aButtons": [ "copy", { "sExtends": "csv", "sTitle": @generateDocumentName() }, { "sExtends": "xls", "sTitle": @generateDocumentName() }, { "sExtends": "pdf", "sTitle": @generateDocumentName(), "sPdfMessage": "SmartAdmin PDF Export", "sPdfSize": "letter" }, { "sExtends": "print", "sMessage": "Generated by SmartAdmin <i>(press Esc to close)</i>" } ], "sSwfPath": "<%= asset_path('copy_csv_xls_pdf.swf') %>" }, "autoWidth" : true, "preDrawCallback" : -> # Initialize the responsive datatables helper once. if !self.$_responsiveHelperDatatableTabletools self.$_responsiveHelperDatatableTabletools = new ResponsiveDatatablesHelper($('#datatable_tabletools'), self.$_breakpointDefinition) , "rowCallback" : (nRow) -> self.$_responsiveHelperDatatableTabletools.createExpandIcon(nRow) , "drawCallback" : (oSettings) => @$_responsiveHelperDatatableTabletools.respond() # Setup bulk control containers if requiredkCo @setupBulkControls() if @$_bulkControls.length > 0 $("#datatable_tabletools thead th input[type=text]").on 'keyup change', -> self.$_dataTables .column( $(this).parent().index()+':visible' ) .search( this.value ) .draw() # end of setup: -> }}}
Thank you in advance and wish you a wonderful weekend.