mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Reload the parent table when adding or removing substitutes
This commit is contained in:
parent
ea4c4c514f
commit
8512c2db75
@ -150,6 +150,13 @@ function newPartFromBomWizard(e) {
|
||||
*/
|
||||
function bomSubstitutesDialog(bom_item_id, substitutes, options={}) {
|
||||
|
||||
// Reload data for the parent table
|
||||
function reloadParentTable() {
|
||||
if (options.table) {
|
||||
options.table.bootstrapTable('refresh');
|
||||
}
|
||||
}
|
||||
|
||||
function renderSubstituteRow(substitute) {
|
||||
|
||||
var pk = substitute.pk;
|
||||
@ -244,6 +251,8 @@ function bomSubstitutesDialog(bom_item_id, substitutes, options={}) {
|
||||
confirm: true,
|
||||
onSuccess: function() {
|
||||
$(opts.modal).find(`#substitute-row-${pk}`).remove();
|
||||
|
||||
reloadParentTable();
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -264,6 +273,9 @@ function bomSubstitutesDialog(bom_item_id, substitutes, options={}) {
|
||||
|
||||
// Re-enable the "submit" button
|
||||
$(opts.modal).find('#modal-form-submit').prop('disabled', false);
|
||||
|
||||
// Reload the parent BOM table
|
||||
reloadParentTable();
|
||||
}
|
||||
});
|
||||
|
||||
@ -783,7 +795,7 @@ function loadBomTable(table, options) {
|
||||
pk,
|
||||
subs,
|
||||
{
|
||||
|
||||
table: table,
|
||||
}
|
||||
);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user