fnReloadAjax and new fnServerParams

fnReloadAjax and new fnServerParams

ythibodeauythibodeau Posts: 6Questions: 0Answers: 0
edited April 2013 in General
How can I avoid this?

[code]$('#search').click( function() {
lab.fnReloadAjax('ajax/get_results.php?' +
'searchunread=' + $('#searchunread:checked').length +
'&searchabnormal=' + $('#searchabnormal:checked').length +
'&searchcritical=' + $('#searchcritical:checked').length +
'&searchcompleted=' + $('#searchcompleted:checked').length +
'&searchtoreview=' + $('#searchtoreview:checked').length +
'&searchramq=' + $('#searchramq').val() +
'&searchfile=' + $('#searchfile').val() +
'&searchrequest=' + $('#searchrequest').val());
});[/code]

There's got to be a way like when I first initiate my table, like so:

[code]
var lab = $('#module #results table').dataTable({
'fnServerParams': function(aoData) {
aoData.push({'name': 'mod', 'value': 'lab'});
}
...
[/code]

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Could you just put the options such as `searchunread` into fnServerParams ? The values will be resulted at the time of the request.

    Allan
  • ythibodeauythibodeau Posts: 6Questions: 0Answers: 0
    true, lol! Wow, when you are programming an entire day, at the end of it, you are just exhausted and can't focus. Thanks!
This discussion has been closed.