Skip to content

Commit

Permalink
fix: bug in datatables filter
Browse files Browse the repository at this point in the history
  • Loading branch information
francesco-filicetti committed Nov 21, 2024
1 parent 4d860e4 commit 0ee5f63
Showing 1 changed file with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,24 +151,24 @@
}
});

$('#search_year, #search_box, #search_category').on('keypress', function () {
$('#search_year, #search_box, #search_category').on('change keypress', function () {
var year = $('#search_year').val();
var category = $('#search_category').val();
if (typeof category === 'undefined'){
category = "";
}
var structure = $('#search_structure').val();
if (typeof structure === 'undefined'){
structure = "";
}
if (event.key === "Enter") {
var year = $('#search_year').val();
var category = $('#search_category').val();
if (typeof category === 'undefined'){
category = "";
}
var text = $('#search_box').val();
var structure = $('#search_structure').val();
if (typeof structure === 'undefined'){
structure = "";
}
var args = '{"year": "'+year+'", '+
'"text": "'+text+'", '+
'"category": "'+category+'", '+
'"structure": "'+structure+'"}';
datatable.search(args).draw();
}
var args = '{"year": "'+year+'", '+
'"text": "'+text+'", '+
'"category": "'+category+'", '+
'"structure": "'+structure+'"}';
datatable.search(args).draw();
} );


Expand Down

0 comments on commit 0ee5f63

Please sign in to comment.