Skip to content

Commit

Permalink
remove beforeDestroy
Browse files Browse the repository at this point in the history
  • Loading branch information
noogen committed Apr 14, 2021
1 parent e99f0f5 commit 9833ed1
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 71 deletions.
20 changes: 9 additions & 11 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"/index.js": "/index.js?id=3a1f50c265144aaa7e50"
"/index.js": "/index.js?id=2e55ab288c75c2a1b2ce"
}
20 changes: 9 additions & 11 deletions example/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* vue-datatables-net
* Vue jQuery DataTables.net wrapper component
*
* @version v1.5.0
* @version v1.5.1
* @author [email protected]
* @repository https://github.com/niiknow/vue-datatables-net.git
*/
Expand Down Expand Up @@ -770,8 +770,15 @@ var myUniqueId = 1;
// const rows = event.dataTable.rows( event.indexes )
// const data = rows.data()
});
} // wire up edit, delete, and/or action buttons
}

$el.find('#vdtnetable1_wrapper').on('remove', function () {
if (that.dataTable) {
that.dataTable.destroy(true);
}

that.dataTable = null;
}); // wire up edit, delete, and/or action buttons

$el.on('click', '[data-action]', function (e) {
e.preventDefault();
Expand Down Expand Up @@ -851,15 +858,6 @@ var myUniqueId = 1;
that.reload();
}
},
beforeDestroy: function beforeDestroy() {
var that = this;

if (that.dataTable) {
that.dataTable.destroy(true);
}

that.dataTable = null;
},
methods: {
/**
* Vue.compile a template string and return the compiled function
Expand Down
2 changes: 1 addition & 1 deletion example/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion example/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"/index.js": "/index.js?id=fb6edaa8b910f9bad451"
"/index.js": "/index.js?id=98012e669c8c525049fb"
}
68 changes: 34 additions & 34 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vue-datatables-net",
"description": "Vue jQuery DataTables.net wrapper component",
"version": "1.5.0",
"version": "1.5.1",
"author": "[email protected]",
"license": "MIT",
"main": "dist/index.js",
Expand Down Expand Up @@ -45,7 +45,7 @@
"datatables.net-responsive-bs4": "^2.2.7",
"datatables.net-select-bs4": "^1.3.3",
"eslint": "^7.24.0",
"eslint-config-prettier": "^8.1.0",
"eslint-config-prettier": "^8.2.0",
"eslint-friendly-formatter": "^4.0.1",
"eslint-plugin-vue": "^7.9.0",
"eslint-webpack-plugin": "^2.5.3",
Expand All @@ -54,6 +54,6 @@
"vue": "^2.6.12",
"vue-loader": "^15.9.6",
"vue-template-compiler": "^2.6.12",
"webpack": "^5.31.2"
"webpack": "^5.33.1"
}
}
16 changes: 8 additions & 8 deletions src/VdtnetTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,14 @@ export default {
})
}
$el.find('#vdtnetable1_wrapper').on('remove', () => {
if (that.dataTable) {
that.dataTable.destroy(true)
}
that.dataTable = null
})
// wire up edit, delete, and/or action buttons
$el.on('click', '[data-action]', (e) => {
e.preventDefault()
Expand Down Expand Up @@ -578,14 +586,6 @@ export default {
that.reload()
}
},
beforeDestroy() {
const that = this
if (that.dataTable) {
that.dataTable.destroy(true)
}
that.dataTable = null
},
methods: {
/**
* Vue.compile a template string and return the compiled function
Expand Down

0 comments on commit 9833ed1

Please sign in to comment.