Adding parameters to a URL to "pre-filter"

Adding parameters to a URL to "pre-filter"

geethugeethu Posts: 1Questions: 1Answers: 0
edited February 2016 in Free community support

I want to prefilter a table via parsing parameter from the URL. I follow the datatable oSearch method, but it's not working. My code is given below:

   $(document).ready(function() {

    var params = location.search.substr(location.search.indexOf("?")+1) || "";

    var varTable = $('table' + tableId).DataTable({
      'columns': varColumns,
      'oSearch': {'sSearch': params},
      'processing': true,
      'serverSide': true,
      'stateSave': true,
      'stateDuration': -1,
      'ajax': $(tableId).data('source'),
      'pagingType': 'full_numbers',
      'language': {
          'lengthMenu': '_MENU_ records per page',
          'paginate': {
              'previous': 'Prev',
              'next': 'Next'
          }
      }
    }); 

Answers

  • allanallan Posts: 63,761Questions: 1Answers: 10,510 Site admin

    Per the forum rules, please link to a test page showing the issue so it can be debugged.

    Allan

This discussion has been closed.