Adding parameters to a URL to "pre-filter"
Adding parameters to a URL to "pre-filter"
geethu
Posts: 1Questions: 1Answers: 0
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'
}
}
});
This discussion has been closed.
Answers
Per the forum rules, please link to a test page showing the issue so it can be debugged.
Allan