mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-30 20:55:42 +00:00 
			
		
		
		
	Merge pull request #2154 from SchrodingersGat/filter-bug-fix
Fix table filtering bug
This commit is contained in:
		| @@ -283,12 +283,16 @@ 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>`); | ||||
|  | ||||
|     // If there are available filters, add them in! | ||||
|     if (filters.length > 0) { | ||||
|     // If there are no filters defined for this table, exit now | ||||
|     if (jQuery.isEmptyObject(getAvailableTableFilters(tableKey))) { | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|     // If there are filters currently "in use", add them in! | ||||
|     element.append(`<button id='${add}' title='{% trans "Add new filter" %}' class='btn btn-default filter-tag'><span class='fas fa-filter'></span></button>`); | ||||
|  | ||||
|     if (Object.keys(filters).length > 0) { | ||||
|             element.append(`<button id='${clear}' title='{% trans "Clear all filters" %}' class='btn btn-default filter-tag'><span class='fas fa-trash-alt'></span></button>`); | ||||
|         element.append(`<button id='${clear}' title='{% trans "Clear all filters" %}' class='btn btn-default filter-tag'><span class='fas fa-backspace icon-red'></span></button>`); | ||||
|     } | ||||
|  | ||||
|     for (var key in filters) { | ||||
| @@ -298,7 +302,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() { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user