mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
load category tables "Just in time"
This commit is contained in:
parent
335f0ceb79
commit
52a0665e32
@ -240,9 +240,6 @@
|
||||
|
||||
{% endif %}
|
||||
|
||||
// Enable left-hand navigation sidebar
|
||||
enableSidebar('category');
|
||||
|
||||
// Enable breadcrumb tree view
|
||||
enableBreadcrumbTree({
|
||||
label: 'category',
|
||||
@ -258,18 +255,20 @@
|
||||
}
|
||||
});
|
||||
|
||||
loadPartCategoryTable(
|
||||
$('#subcategory-table'), {
|
||||
params: {
|
||||
{% if category %}
|
||||
parent: {{ category.pk }},
|
||||
{% else %}
|
||||
parent: null,
|
||||
{% endif %}
|
||||
},
|
||||
allowTreeView: true,
|
||||
}
|
||||
);
|
||||
onPanelLoad('subcategories', function() {
|
||||
loadPartCategoryTable(
|
||||
$('#subcategory-table'), {
|
||||
params: {
|
||||
{% if category %}
|
||||
parent: {{ category.pk }},
|
||||
{% else %}
|
||||
parent: null,
|
||||
{% endif %}
|
||||
},
|
||||
allowTreeView: true,
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
$("#cat-create").click(function() {
|
||||
|
||||
@ -339,19 +338,24 @@
|
||||
|
||||
{% endif %}
|
||||
|
||||
loadPartTable(
|
||||
"#part-table",
|
||||
"{% url 'api-part-list' %}",
|
||||
{
|
||||
params: {
|
||||
{% if category %}category: {{ category.id }},
|
||||
{% else %}category: "null",
|
||||
{% endif %}
|
||||
onPanelLoad('parts', function() {
|
||||
loadPartTable(
|
||||
"#part-table",
|
||||
"{% url 'api-part-list' %}",
|
||||
{
|
||||
params: {
|
||||
{% if category %}category: {{ category.id }},
|
||||
{% else %}category: "null",
|
||||
{% endif %}
|
||||
},
|
||||
buttons: ['#part-options'],
|
||||
checkbox: true,
|
||||
gridView: true,
|
||||
},
|
||||
buttons: ['#part-options'],
|
||||
checkbox: true,
|
||||
gridView: true,
|
||||
},
|
||||
);
|
||||
);
|
||||
});
|
||||
|
||||
// Enable left-hand navigation sidebar
|
||||
enableSidebar('category');
|
||||
|
||||
{% endblock %}
|
||||
|
Loading…
Reference in New Issue
Block a user