mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-28 03:16:25 -06:00
#6372: Updating “per page” count does not refresh list
This commit is contained in:
parent
b746d6930f
commit
7412039441
BIN
netbox/project-static/dist/netbox.js
vendored
BIN
netbox/project-static/dist/netbox.js
vendored
Binary file not shown.
BIN
netbox/project-static/dist/netbox.js.map
vendored
BIN
netbox/project-static/dist/netbox.js.map
vendored
Binary file not shown.
@ -265,6 +265,19 @@ function initSelectAll() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handlePerPageSelect(event: Event) {
|
||||||
|
const select = event.currentTarget as HTMLSelectElement;
|
||||||
|
if (select.form !== null) {
|
||||||
|
select.form.submit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function initPerPage() {
|
||||||
|
for (const element of getElements<HTMLSelectElement>('select.per-page')) {
|
||||||
|
element.addEventListener('change', handlePerPageSelect);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export function initButtons() {
|
export function initButtons() {
|
||||||
for (const func of [
|
for (const func of [
|
||||||
initRackElevation,
|
initRackElevation,
|
||||||
@ -272,6 +285,7 @@ export function initButtons() {
|
|||||||
initReslug,
|
initReslug,
|
||||||
initSelectAll,
|
initSelectAll,
|
||||||
initPreferenceUpdate,
|
initPreferenceUpdate,
|
||||||
|
initPerPage,
|
||||||
]) {
|
]) {
|
||||||
func();
|
func();
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<div class="input-group input-group-sm">
|
<div class="input-group input-group-sm">
|
||||||
<select name="per_page" class="form-select" id="per_page">
|
<select name="per_page" class="form-select per-page">
|
||||||
{% for n in settings.PER_PAGE_DEFAULTS %}
|
{% for n in settings.PER_PAGE_DEFAULTS %}
|
||||||
<option value="{{ n }}"{% if page.paginator.per_page == n %} selected="selected"{% endif %}>{{ n }}</option>
|
<option value="{{ n }}"{% if page.paginator.per_page == n %} selected="selected"{% endif %}>{{ n }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
Loading…
Reference in New Issue
Block a user