mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
bug fix: enable "table reload" for tables without any filters
- setupFilterList function was returning too early
This commit is contained in:
parent
367b80c17a
commit
a0140dc9a2
@ -283,6 +283,11 @@ function setupFilterList(tableKey, table, target) {
|
||||
|
||||
element.append(`<button id='reload-${tableKey}' title='{% trans "Reload data" %}' class='btn btn-default filter-tag'><span class='fas fa-redo-alt'></span></button>`);
|
||||
|
||||
// Callback for reloading the table
|
||||
element.find(`#reload-${tableKey}`).click(function() {
|
||||
$(table).bootstrapTable('refresh');
|
||||
});
|
||||
|
||||
// If there are no filters defined for this table, exit now
|
||||
if (jQuery.isEmptyObject(getAvailableTableFilters(tableKey))) {
|
||||
return;
|
||||
@ -303,11 +308,6 @@ function setupFilterList(tableKey, table, target) {
|
||||
element.append(`<div title='${description}' class='filter-tag'>${title} = ${value}<span ${tag}='${key}' class='close'>x</span></div>`);
|
||||
}
|
||||
|
||||
// Callback for reloading the table
|
||||
element.find(`#reload-${tableKey}`).click(function() {
|
||||
$(table).bootstrapTable('refresh');
|
||||
});
|
||||
|
||||
// Add a callback for adding a new filter
|
||||
element.find(`#${add}`).click(function clicked() {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user