How to search columns on a value that I update?

How to search columns on a value that I update?

rachelf99rachelf99 Posts: 1Questions: 1Answers: 0
var table = $('#experimentTab').DataTable{
  "initComplete": function(){ 
    // In that function I update some values of the datatables 
    var rows = table.rows().data(); 
    rows.each(function (index) { 
    // update the status for each rows 
  } 
  table.rows().data(rows).draw(); 
  }
});
  $('#data_search').submit(function(e) { 
    e.preventDefault(); 
    var status = $('#status').val(); 
    table.search('').columns().search('').draw(); 
    table.column(1).search().draw(); 
}

However, my problem is that the 'search' dosen't work. The search results are still same as those before updates. I console out the Datatables's data, It changes indeed. What should I do to search columns?

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,234Questions: 1Answers: 2,597
    Answer ✓

    I tried something similar here: https://live.datatables.net/jifamevo/1/edit and that's working as expected - searching for 'Wordsmith' afterwards does show the expected value.

    Could you look at that, please, and see if it helps. If it's still not working for you, please can you update my example, or link to your page, so that we can see the problem.

    Colin

Sign In or Register to comment.