SearchPane Feature not working for my datatable

SearchPane Feature not working for my datatable

emmyt08emmyt08 Posts: 1Questions: 1Answers: 0

I am currently using the searchPane function to search for data on my datatable loaded from mysql database. When I click on the search pane it doesn't show anything. It says no matching record found.
However, I tried the searchpane using a table with static data. By static data I mean data created on table directly and it worked
<tbody>
<tr> <td>Tiger Nixon</td> <td>System Architect</td> <td>Edinburgh</td> <td>61</td> <td>2011/04/25</td> <td>$320,800</td> </tr> <tr> <td>Garrett Winters</td> <td>Accountant</td> <td>Tokyo</td> <td>63</td> <td>2011/07/25</td> <td>$170,750</td> </tr>
My question is, does the search pane not work for data loaded from database or is there a special way to use it?

This is the javascript I have been using:

$(document).ready( function () { $('#mytable1').DataTable( { searchPane: true, stateSave: true } ); } );

Please I will appreciate your help.

thanks

Answers

  • tangerinetangerine Posts: 3,350Questions: 37Answers: 394

    Although the SearchPane Feature List mentions server-side processing support,
    the SearchPane actually does not yet support server-side processing.

  • colincolin Posts: 15,143Questions: 1Answers: 2,586

    Hi @emmyt08 ,

    As @tangerine said, if you serverSide enabled, it won't work - as the data is only returned when required. Therefore, the searchPane lists wouldn't have the data to be constructed.

    But, it would still work if you're loading from a remote database with , with the client doing all the processing. For that to work, you would need to rebuild the searchPane in the Ajax success handler or the xhr. Take a look at the rebuild usage in the API section of this blog post.

    Cheers,

    Colin

This discussion has been closed.