Fixed table filters

This commit is contained in:
Bernd Bestel
2020-11-15 09:21:54 +01:00
parent d1846b76ff
commit 185627af7d
5 changed files with 9 additions and 7 deletions

View File

@@ -29,7 +29,7 @@ $("#product-group-filter").on("change", function()
value = ""; value = "";
} }
productsTable.column(7).search(value).draw(); productsTable.column(6).search(value).draw();
}); });
$("#clear-filter-button").on("click", function() $("#clear-filter-button").on("click", function()

View File

@@ -88,7 +88,7 @@ $("#status-filter").on("change", function()
$('.recipe-gallery-item').removeClass('d-none'); $('.recipe-gallery-item').removeClass('d-none');
if (value !== "") if (value !== "")
{ {
if (value === 'enoughinstock') if (value === 'Xenoughinstock')
{ {
$('.recipe-gallery-item').not('.recipe-enoughinstock').addClass('d-none'); $('.recipe-gallery-item').not('.recipe-enoughinstock').addClass('d-none');
} }

View File

@@ -30,7 +30,7 @@ $("#entity-filter").on("change", function()
} }
userfieldsTable.column(1).search(value).draw(); userfieldsTable.column(1).search(value).draw();
$("#new-userfield-button").attr("href", U("/userfield/new?entity=" + value)); $("#new-userfield-button").attr("href", U("/userfield/new?embedded&entity=" + value));
}); });
$("#clear-filter-button").on("click", function() $("#clear-filter-button").on("click", function()
@@ -78,8 +78,9 @@ $(document).on('click', '.userfield-delete-button', function(e)
}); });
}); });
if (typeof GetUriParam("entity") !== "undefined" && !GetUriParam("entity").isEmpty()) if (GetUriParam("entity") != undefined && !GetUriParam("entity").isEmpty())
{ {
$("#entity-filter").val(GetUriParam("entity")); $("#entity-filter").val(GetUriParam("entity"));
$("#entity-filter").trigger("change"); $("#entity-filter").trigger("change");
$("#name").focus();
} }

View File

@@ -59,7 +59,7 @@
<select class="form-control" <select class="form-control"
id="status-filter"> id="status-filter">
<option value="all">{{ $__t('All') }}</option> <option value="all">{{ $__t('All') }}</option>
<option value="enoughinstock">{{ $__t('Enough in stock') }}</option> <option value="Xenoughinstock">{{ $__t('Enough in stock') }}</option>
<option value="enoughinstockwithshoppinglist">{{ $__t('Not enough in stock, but already on the shopping list') }}</option> <option value="enoughinstockwithshoppinglist">{{ $__t('Not enough in stock, but already on the shopping list') }}</option>
<option value="notenoughinstock">{{ $__t('Not enough in stock') }}</option> <option value="notenoughinstock">{{ $__t('Not enough in stock') }}</option>
</select> </select>
@@ -153,7 +153,7 @@
{{ FindObjectInArrayByPropertyValue($recipesResolved, 'recipe_id', $recipe->id)->missing_products_count }} {{ FindObjectInArrayByPropertyValue($recipesResolved, 'recipe_id', $recipe->id)->missing_products_count }}
</td> </td>
<td class="d-none"> <td class="d-none">
@if(FindObjectInArrayByPropertyValue($recipesResolved, 'recipe_id', $recipe->id)->need_fulfilled == 1) enoughinstock @elseif(FindObjectInArrayByPropertyValue($recipesResolved, 'recipe_id', $recipe->id)->need_fulfilled_with_shopping_list == 1) enoughinstockwithshoppinglist @else notenoughinstock @endif @if(FindObjectInArrayByPropertyValue($recipesResolved, 'recipe_id', $recipe->id)->need_fulfilled == 1) Xenoughinstock @elseif(FindObjectInArrayByPropertyValue($recipesResolved, 'recipe_id', $recipe->id)->need_fulfilled_with_shopping_list == 1) enoughinstockwithshoppinglist @else notenoughinstock @endif
</td> </td>
<td class="d-none"> <td class="d-none">
@foreach(FindAllObjectsInArrayByPropertyValue($recipePositionsResolved, 'recipe_id', $recipe->id) as $recipePos) @foreach(FindAllObjectsInArrayByPropertyValue($recipePositionsResolved, 'recipe_id', $recipe->id) as $recipePos)

View File

@@ -25,7 +25,8 @@
</div> </div>
<div class="related-links collapse d-md-flex order-2 width-xs-sm-100 m-1 mt-md-0 mb-md-0 float-right" <div class="related-links collapse d-md-flex order-2 width-xs-sm-100 m-1 mt-md-0 mb-md-0 float-right"
id="related-links"> id="related-links">
<a class="btn btn-primary responsive-button show-as-dialog-link" <a id="new-userfield-button"
class="btn btn-primary responsive-button show-as-dialog-link"
href="{{ $U('/userfield/new?embedded') }}"> href="{{ $U('/userfield/new?embedded') }}">
{{ $__t('Add') }} {{ $__t('Add') }}
</a> </a>