Bug 32030: Fix condition for DT destruction

Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Jonathan Druart 2022-07-13 17:11:05 +02:00 committed by Tomas Cohen Arazi
parent 715ce3806d
commit a596acc28e
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F
8 changed files with 24 additions and 20 deletions

View file

@ -266,11 +266,6 @@ export default {
}, agreement_table_settings, 1) }, agreement_table_settings, 1)
}, },
destroy_table: function () {
$('#agreement_list')
.DataTable()
.destroy(true)
},
}, },
mounted() { mounted() {
if (!this.building_table) { if (!this.building_table) {
@ -279,8 +274,11 @@ export default {
} }
}, },
beforeUnmount() { beforeUnmount() {
// This delays the closing of the modal, do we really need it? if ($.fn.DataTable.isDataTable('#agreement_list')) {
//this.destroy_table() $('#agreement_list')
.DataTable()
.destroy(true)
}
}, },
components: { Toolbar }, components: { Toolbar },
name: "AgreementsList", name: "AgreementsList",

View file

@ -243,7 +243,7 @@ export default {
}, },
}, },
beforeUnmount() { beforeUnmount() {
if (!$.fn.DataTable.isDataTable('#package_list')) { if ($.fn.DataTable.isDataTable('#package_list')) {
$('#package_list') $('#package_list')
.DataTable() .DataTable()
.destroy(true) .destroy(true)

View file

@ -136,9 +136,11 @@ export default {
this.build_datatable() this.build_datatable()
}, },
beforeUnmount() { beforeUnmount() {
$('#package_list') if ($.fn.DataTable.isDataTable('#package_list')) {
.DataTable() $('#package_list')
.destroy(true) .DataTable()
.destroy(true)
}
}, },
props: { props: {
resources: Array, resources: Array,

View file

@ -259,7 +259,7 @@ export default {
}, },
}, },
beforeUnmount() { beforeUnmount() {
if ( ! $.fn.DataTable.isDataTable( '#title_list' ) ) { if ($.fn.DataTable.isDataTable('#title_list')) {
$('#title_list') $('#title_list')
.DataTable() .DataTable()
.destroy(true) .destroy(true)

View file

@ -98,9 +98,11 @@ export default {
this.build_datatable() this.build_datatable()
}, },
beforeUnmount() { beforeUnmount() {
$('#title_list') if ($.fn.DataTable.isDataTable('#title_list')) {
.DataTable() $('#title_list')
.destroy(true) .DataTable()
.destroy(true)
}
}, },
props: { props: {
package_id: String, package_id: String,

View file

@ -211,7 +211,7 @@ export default {
}, },
}, },
beforeUnmount() { beforeUnmount() {
if (!$.fn.DataTable.isDataTable('#package_list')) { if ($.fn.DataTable.isDataTable('#package_list')) {
$('#package_list') $('#package_list')
.DataTable() .DataTable()
.destroy(true) .destroy(true)

View file

@ -70,9 +70,11 @@ export default {
this.build_datatable() this.build_datatable()
}, },
beforeUnmount() { beforeUnmount() {
$('#package_list') if ($.fn.DataTable.isDataTable('#package_list')) {
.DataTable() $('#package_list')
.destroy(true) .DataTable()
.destroy(true)
}
}, },
props: { props: {
resources: Array, resources: Array,

View file

@ -201,7 +201,7 @@ export default {
}, },
}, },
beforeUnmount() { beforeUnmount() {
if (!$.fn.DataTable.isDataTable('#title_list')) { if ($.fn.DataTable.isDataTable('#title_list')) {
$('#title_list') $('#title_list')
.DataTable() .DataTable()
.destroy(true) .destroy(true)