1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-25 03:30:30 +02:00

Add "search transactions page"

This commit is contained in:
Yohann D'ANELLO
2020-08-03 18:49:15 +02:00
parent 55580bc11e
commit 985a5ca876
15 changed files with 455 additions and 196 deletions

View File

@ -10,6 +10,7 @@ $(document).ready(function () {
if (!name_field)
name_field = "name";
let input = target.val();
$("#" + prefix + "_reset").removeClass("d-none");
$.getJSON(api_url + (api_url.includes("?") ? "&" : "?") + "format=json&search=^" + input + api_url_suffix, function(objects) {
let html = "";
@ -39,4 +40,12 @@ $(document).ready(function () {
}
});
});
$(".autocomplete-reset").click(function() {
let name = $(this).attr("id").replace("_reset", "");
$("#" + name + "_pk").val("");
$("#" + name).val("");
$("#" + name + "_list").html("");
$(this).addClass("d-none");
});
});