FuriosoJack / TableHTMLExport

Plugin de Jquery que exporta una tabla HTML a JSON, CSV, TXT, o PDF y forzar al navegador a descargar el archivo generado.
MIT License
14 stars 17 forks source link

how export row after filted #5

Open TiagoPimentt opened 2 years ago

TiagoPimentt commented 2 years ago

I have this code in use. But not export only filted

<div class="modo-box" style="">
    <div class="form-group">
    <input class="form-control" id="myInput" type="text" placeholder="Buscar..." autocomplete="off">
    <p id="emptyMsg2" style="display: none;">Nenhum registro encontrado.</p>
</div>
<div class="card card-body box-fix">
<table class="table table-bordered table-striped pt-5" id="table3">
    <thead>
        <tr> // this is table filted but when click in button for export get all rows
            <th class="ignore">#</th>
            <th>Marketplace</th>
            <th>Erro</th>
            <th>Total</th>
            <th>Representa</th>
        </tr>
    </thead>
    <tbody class="bodyResult">
        <tr>
            <td class="ignore">1</td>
            <td>VIAVAREJO</td>
            <td>ean - Sua loja já vende o produto Cinta Redutora de Medidas Cintura Hot Shapers Neotex Unissex com ean 7898601063189.</td>
            <td>2</td>
            <td>15.38%</td>
        </tr>
        <tr style="display: none;">
            <td class="ignore">2</td>
            <td>VIAVAREJO</td>
            <td>Imagens - É obrigatório informar pelo menos uma imagem</td>
            <td>2</td>
            <td>15.38%</td>
        </tr>
        <tr style="display: none;">
            <td class="ignore">3</td>
            <td>VIAVAREJO</td>
            <td>height - A altura deve ser um valor entre 0.01 e 7.00</td>
            <td>2</td>
            <td>15.38%</td>
        </tr>
    </tbody>
</table>
</div>
<div class="row container-fluid pt-4">
        <button class="btn btn-primary pull-right" id="export3">
            <i class="fa fa-file-excel-o" aria-hidden="true"></i> Exportar Dados </button>
    </div>
    $('#export3').click(function(){
        $("#table3").tableHTMLExport(
            {   type: 'csv',
                ignoreColumns:'.ignore',
                ignoreRows:'.ignore',
                filename: 'tebela_detalhes_erros_transf.csv'
            }
        );
    });