Fix mode switching for part category table (#3881)

* Fix mode switching for part category table

* Fix for StockLocation table
This commit is contained in:
Oliver 2022-10-30 15:04:48 +11:00 committed by GitHub
parent 3dd92416fe
commit 5922d9fbff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 40 additions and 36 deletions

View File

@ -1878,15 +1878,16 @@ function loadPartCategoryTable(table, options) {
},
event: () => {
inventreeSave('category-tree-view', 0);
table.bootstrapTable(
'refreshOptions',
{
treeEnable: false,
serverSort: true,
search: true,
pagination: true,
}
);
// Adjust table options
options.treeEnable = false;
options.serverSort = false;
options.search = true;
options.pagination = true;
// Destroy and re-create the table
table.bootstrapTable('destroy');
loadPartCategoryTable(table, options);
}
},
{
@ -1897,15 +1898,16 @@ function loadPartCategoryTable(table, options) {
},
event: () => {
inventreeSave('category-tree-view', 1);
table.bootstrapTable(
'refreshOptions',
{
treeEnable: true,
serverSort: false,
search: false,
pagination: false,
}
);
// Adjust table options
options.treeEnable = true;
options.serverSort = false;
options.search = false;
options.pagination = false;
// Destroy and re-create the table
table.bootstrapTable('destroy');
loadPartCategoryTable(table, options);
}
}
] : [],

View File

@ -2351,15 +2351,16 @@ function loadStockLocationTable(table, options) {
},
event: () => {
inventreeSave('location-tree-view', 0);
table.bootstrapTable(
'refreshOptions',
{
treeEnable: false,
serverSort: true,
search: true,
pagination: true,
}
);
// Adjust table options
options.treeEnable = false;
options.serverSort = true;
options.search = true;
options.pagination = true;
// Destroy and re-create the table
table.bootstrapTable('destroy');
loadStockLocationTable(table, options);
}
},
{
@ -2370,15 +2371,16 @@ function loadStockLocationTable(table, options) {
},
event: () => {
inventreeSave('location-tree-view', 1);
table.bootstrapTable(
'refreshOptions',
{
treeEnable: true,
serverSort: false,
search: false,
pagination: false,
}
);
// Adjust table options
options.treeEnable = true;
options.serverSort = false;
options.search = false;
options.pagination = false;
// Destroy and re-create the table
table.bootstrapTable('destroy');
loadStockLocationTable(table, options);
}
}
] : [],