Table search and Data.push

Table search and Data.push

KlonGonVIKlonGonVI Posts: 1Questions: 1Answers: 0

Hi everyone,

I testing today the function "table.column(i).search()'', Work fine for all but I have a problem with Table create with data.push.... it's normal ?

$('#dataTables-IMPSEQ').DataTable({
        data: data,
        deferRender: true,
        "bDestroy": true,
        scrollY: true,
        pageLength: 10,
        scrollX: true,
        scrollCollapse: false,
        paging: true,
        autoFill: true,
        language: {
          url: 'dataTables.French.json'
        },
      });

      $('#dataTables-IMPSEQ thead tr').clone(true).appendTo('#dataTables-IMPSEQ thead');
      $('#dataTables-IMPSEQ thead tr:eq(1) th').each(function(i) {
        var title = $(this).text();
        $(this).html('<input type="text" class="form-control" />');

        $('input', this).on('keyup change', function() {
          if (table.column(i).search() !== this.value) {
            table
              .column(i)
              .search(this.value)
              .draw();
          }
        });

Answers

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    Hi @KlonGonVI ,

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

This discussion has been closed.