mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-31 04:32:06 +08:00
Fix loading of non-repository tables on item cards changes [SCI-9970]
This commit is contained in:
parent
a6c0c7294b
commit
c73bc0bed1
9 changed files with 12 additions and 12 deletions
|
@ -93,7 +93,7 @@
|
|||
updateCallback = (data) => {
|
||||
if (!data?.value) return;
|
||||
// reload dataTable
|
||||
if ($('.dataTable')[0]) $('.dataTable').DataTable().ajax.reload(null, false);
|
||||
if ($('.dataTable.repository-dataTable')[0]) $('.dataTable.repository-dataTable').DataTable().ajax.reload(null, false);
|
||||
// update item card stock column
|
||||
window.manageStockCallback && window.manageStockCallback(data.value);
|
||||
$link.data('manageStockUrl', data.value.stock_url)
|
||||
|
|
|
@ -270,7 +270,7 @@ export default {
|
|||
},
|
||||
success: (result) => {
|
||||
$this.addRelationCallback(result, relation);
|
||||
if ($('.dataTable')[0]) $('.dataTable').DataTable().ajax.reload(null, false);
|
||||
if ($('.dataTable.repository-dataTable')[0]) $('.dataTable.repository-dataTable').DataTable().ajax.reload(null, false);
|
||||
}
|
||||
});
|
||||
this.close();
|
||||
|
|
|
@ -544,7 +544,7 @@ export default {
|
|||
}).done((response) => {
|
||||
if (response) {
|
||||
this.customColumns = this.customColumns.map((col) => (col.id === response.id ? { ...col, ...response } : col));
|
||||
if ($('.dataTable')[0]) $('.dataTable').DataTable().ajax.reload(null, false);
|
||||
if ($('.dataTable.repository-dataTable')[0]) $('.dataTable.repository-dataTable').DataTable().ajax.reload(null, false);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
@ -560,7 +560,7 @@ export default {
|
|||
async unlinkItem() {
|
||||
await axios.delete(this.selectedToUnlink.unlink_path);
|
||||
this.loadRepositoryRow(this.currentItemUrl);
|
||||
if ($('.dataTable')[0]) $('.dataTable').DataTable().ajax.reload(null, false);
|
||||
if ($('.dataTable.repository-dataTable')[0]) $('.dataTable.repository-dataTable').DataTable().ajax.reload(null, false);
|
||||
this.selectedToUnlink = null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ export default {
|
|||
break;
|
||||
}
|
||||
Object.assign($this.$data, { isEditing: false, isSaving: false, values: result?.value });
|
||||
if ($('.dataTable')[0]) $('.dataTable').DataTable().ajax.reload(null, false);
|
||||
if ($('.dataTable.repository-dataTable')[0]) $('.dataTable.repository-dataTable').DataTable().ajax.reload(null, false);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
|
@ -166,7 +166,7 @@ export default {
|
|||
} else {
|
||||
this.file_name = '';
|
||||
}
|
||||
if ($('.dataTable')[0]) $('.dataTable').DataTable().ajax.reload(null, false);
|
||||
if ($('.dataTable.repository-dataTable')[0]) $('.dataTable.repository-dataTable').DataTable().ajax.reload(null, false);
|
||||
},
|
||||
error: () => {
|
||||
this.error = I18n.t('repositories.item_card.repository_asset_value.errors.upload_failed_general');
|
||||
|
|
|
@ -186,10 +186,10 @@ export default {
|
|||
success: () => {
|
||||
this.defaultStartDate = this.startDate;
|
||||
this.defaultEndDate = this.endDate;
|
||||
if ($('.dataTable')[0]) {
|
||||
$('.dataTable').DataTable().ajax.reload(null, false);
|
||||
this.reloadRepoItemSidebar();
|
||||
if ($('.dataTable.repository-dataTable')[0]) {
|
||||
$('.dataTable.repository-dataTable').DataTable().ajax.reload(null, false);
|
||||
}
|
||||
this.reloadRepoItemSidebar();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<table class="table"
|
||||
<table class="table repository-dataTable"
|
||||
data-id="<%= @repository.id %>"
|
||||
data-type="live"
|
||||
data-source="<%= index_dt_my_module_repository_path(@my_module, @repository) %>"
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
data-footer-label="<%= assigned_repository_simple_view_footer_label(repository) %>"
|
||||
data-name-column-id="<%= assigned_repository_simple_view_name_column_id(repository) %>"
|
||||
>
|
||||
<table class="table hidden repository-table"
|
||||
<table class="table hidden repository-table repository-dataTable"
|
||||
data-stock-management="<%= repository.has_stock_management? %>"
|
||||
data-stock-consumption-editable="<%= can_update_my_module_stock_consumption?(@my_module) %>">
|
||||
<thead>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<div class="repository-table">
|
||||
<div class="repository-table-error"></div>
|
||||
<table id="repository-table-<%= repository.id %>" class="table table--reorderable-columns"
|
||||
<table id="repository-table-<%= repository.id %>" class="table table--reorderable-columns repository-dataTable"
|
||||
data-current-uri="<%= request.original_url %>"
|
||||
data-repository-id="<%= repository.id %>"
|
||||
data-source="<%= repository_index_link %>"
|
||||
|
|
Loading…
Reference in a new issue