reindexing search columns after updating a cell

reindexing search columns after updating a cell

farokojilfarokojil Posts: 1Questions: 1Answers: 0

Hi,

I have this example table

<table id="example">
        <thead>
            <tr>
                <th></th>
                <th>Name</th>
            </tr>
        </thead>
 
        <tbody>
            <tr>
                <td data-search="starred"><button class='js-star' /></td>
                <td>Some dude</td>
            </tr>
            <tr>
                <td data-search=""><button class='js-star' /></td>
                <td>Some dudette</td>
            </tr>
         </tbody>
 </table>
$(document).ready( function () {
  var table = $('#example').dataTable();
  // ...
} );

now if i search for "starred" I will get the row of "Some dude" but then if i click on the button ".js-star" it will make an ajax call and then set data-search="starred" for "Some dudette", However, If i search again for "starred" then "Some dudette" won't show up.
I have read ajax api solution and even tried to update it with fnUpdate also the solutions in this thread but still getting the same result.

What's the solution here?
Thanks.

This discussion has been closed.