export file when the table contains select tags

export file when the table contains select tags

DeboraMezzaliraDeboraMezzalira Posts: 3Questions: 2Answers: 0

I have a table with selects(dropdowns) inside the cells, when I use the export to excel, all the options inside the select come to the excel file. I expected only the selected option appear in the file, what is happening? some one can help me?

<select class="select-button" name="select" onchange="updateColor(this)" onclick="bloqueioCheck(this)"style="background-color:Linen;">
    <option>IMPLANTADO</option>
    <option value="ANÁLISE OP">ANÁLISE OP</option>
    <option value="ATRASADO">ATRASADO</option>
    <option value="EM PRODUÇÃO">EM PRODUÇÃO</option>
    <option value="EMBARCADO">EMBARCADO</option>
    <option value="IMPLANTADO">IMPLANTADO</option>
    <option value="PRONTO">PRONTO</option>
    <option value="RESERVA">RESERVA</option>
    </select> </td>


$(document).ready(function() { var table = $('#GRID').DataTable(); new $.fn.dataTable.Buttons( table, { buttons: [{ extend: 'excel', text: '<i class="fa fa-print"></i>', titleAttr: 'Excel', messageBottom : totalizadores, createEmptyCells: true, exportOptions: { columns: ':visible'}, }] }); table.buttons().container() .appendTo( $('#menuBotoes', table.table().container() ) ); });

Answers

  • colincolin Posts: 15,237Questions: 1Answers: 2,599

    This thread should help. This is talking about getting the value of an input element, but the same principle would apply,

    Colin

This discussion has been closed.