Empty results table if no results

pull/3/head
Davide Bongiovanni 6 years ago
parent e9b670bea8
commit 005ea98f59

@ -178,8 +178,8 @@ function perform_query() {
n:$('#notes').is(':checked') n:$('#notes').is(':checked')
}; };
filter = '0'; filter = '0';
$.getJSON(rootURL + 'query/' + filter + '/' + query, data, function(data) {
$("#results").find("tr:not(:first)").remove(); // Delete all table rows $("#results").find("tr:not(:first)").remove(); // Delete all table rows
$.getJSON(rootURL + 'query/' + filter + '/' + query, data, function(data) {
for(var i = 0; i < data.length; i++) { for(var i = 0; i < data.length; i++) {
var newRow = $('<tr onclick="show_part_info(' + data[i].id + ')"></tr>'); var newRow = $('<tr onclick="show_part_info(' + data[i].id + ')"></tr>');

Loading…
Cancel
Save