Automatically set table filter option to 'equals' if its not set

This commit is contained in:
Dan Sosedoff 2018-08-20 20:42:38 -05:00
parent 3b3d739e91
commit a6eade1ae1
3 changed files with 14 additions and 6 deletions

File diff suppressed because one or more lines are too long

View File

@ -98,7 +98,7 @@
<option value="null">IS NULL</option>
<option value="not_null">NOT NULL</option>
</select>
<input type="text" class="form-control" placeholder="Search query" />
<input type="text" class="form-control" placeholder="Filter value" id="table_filter_value" />
<button class="btn btn-primary btn-sm apply-filters" type="submit">Apply</button>
<button class="btn btn-default btn-sm reset-filters"><i class="fa fa-times"></i></button>
</form>

View File

@ -1093,6 +1093,14 @@ $(document).ready(function() {
showTableContent();
});
// Automatically prefill the filter if it's not set yet
$("select.column").on("change", function() {
if ($("select.filter").val() == "") {
$("select.filter").val("equal");
$("#table_filter_value").focus();
}
});
$("#pagination .next-page").on("click", function() {
var current = $(".current-page").data("page");
var total = $(".current-page").data("pages");