Load stock location pages "on demand"

This commit is contained in:
Oliver Walters 2022-03-19 07:50:37 +11:00
parent 52a0665e32
commit c3ea94827b
2 changed files with 35 additions and 29 deletions

View File

@ -223,13 +223,15 @@
{{ block.super }}
{% if category %}
loadParametricPartTable(
"#parametric-part-table",
{
headers: {{ headers|safe }},
data: {{ parameters|safe }},
}
);
onPanelLoad('parameters', function() {
loadParametricPartTable(
"#parametric-part-table",
{
headers: {{ headers|safe }},
data: {{ parameters|safe }},
}
);
});
$("#toggle-starred").click(function() {
toggleStar({

View File

@ -202,15 +202,17 @@
{% block js_ready %}
{{ block.super }}
loadStockLocationTable($('#sublocation-table'), {
params: {
{% if location %}
parent: {{ location.pk }},
{% else %}
parent: 'null',
{% endif %}
},
allowTreeView: true,
onPanelLoad('sublocations', function() {
loadStockLocationTable($('#sublocation-table'), {
params: {
{% if location %}
parent: {{ location.pk }},
{% else %}
parent: 'null',
{% endif %}
},
allowTreeView: true,
});
});
linkButtonsToSelection(
@ -325,19 +327,21 @@
});
});
loadStockTable($("#stock-table"), {
buttons: [
'#stock-options',
],
params: {
{% if location %}
location: {{ location.pk }},
{% endif %}
part_detail: true,
location_detail: true,
supplier_part_detail: true,
},
url: "{% url 'api-stock-list' %}",
onPanelLoad('stock', function() {
loadStockTable($("#stock-table"), {
buttons: [
'#stock-options',
],
params: {
{% if location %}
location: {{ location.pk }},
{% endif %}
part_detail: true,
location_detail: true,
supplier_part_detail: true,
},
url: "{% url 'api-stock-list' %}",
});
});
enableSidebar('stocklocation');