class GoldList {
    constructor() {
        this.form = document.getElementById("fSearch");

        let tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'));
        let tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
            return new bootstrap.Tooltip(tooltipTriggerEl, {
                html: true,
                trigger: "click"
            });
        });
    }

    ChangePerPage(e) {
        this.form.elements["page"].value = 1;
        this.submit();
    }

    submit() {
        this.form.submit();
    }
}

const goldList = new GoldList();

$(document).on("change", "#perPage", (e) => goldList.ChangePerPage(e));

$(document).on("change", "#sDate, #eDate", (e) => goldList.submit(e));
