=> { row.remove(); }
    });

    // TODO: move this to a JS file that is auto-included by dynamic_group_assignment_modal templatetag
    $("#dynamic_group_assignment_modal").on("show.bs.modal", function (event) {
        const button = $(event.relatedTarget);
        const selected_or_all = button.data("objects");
        const pks_target = document.getElementById("dynamic_group_assignment_pks");
        pks_target.replaceChildren();
        if (selected_or_all == "all") {
            document.getElementBy