Skip to content

Commit

Permalink
fix creating event purpose
Browse files Browse the repository at this point in the history
  • Loading branch information
noogen committed Aug 28, 2019
1 parent e1c773a commit ec5d937
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ One `Purpose` of this component is to extend jQuery DataTables function and feat
Custom events for this component.
```html
<vdtnet-table ...
@tableCreating="doSomethingImmediatelyAfterDataTableCreate"
@tableCreating="doSomethingBeforeDataTableCreate"
@tableCreated="doSomethingImmediatelyAfterTableCreatedAndInitialized"
@reloaded="doSomethingAfterDataLoadOrReloaded"
/>
Expand All @@ -237,8 +237,8 @@ Custom events for this component.
comp.dataTable.on( 'order.dt', function () { eventFired( 'Order' ); } )
}
```
- `tableCreating` this is immediately after jQuery(el).DataTable is called.
- `tableCreated` this is after we have initialized all the columns.
- `tableCreating` this is right before jQuery(el).DataTable(component.options) is called allowing you to modify component options.
- `tableCreated` this is after we called jQuery(el).DataTable and initialized all the columns.
- `reloaded` this is after data has been load/reloaded

## Additional Headers
Expand Down
4 changes: 2 additions & 2 deletions example/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -713,10 +713,10 @@ var myUniqueId = 1;
mounted: function mounted() {
var vm = this;
var jq = vm.jq;
var $el = jq(vm.$refs.table); // console.log(vm.options.buttons)
var $el = jq(vm.$refs.table); // you can access and update the vm.options and $el here before we create the DataTable

vm.$emit('table-creating', vm, $el);
vm.dataTable = $el.DataTable(vm.options);
vm.$emit('table-creating', vm);

if (vm.selectCheckbox) {
// handle select all checkbox
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 lib/index.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"/index.js": "/index.js?id=ac91b689ff131831cbbc",
"/index.js.map": "/index.js.map?id=154eed62452287a86ec0"
"/index.js": "/index.js?id=55021534cbb4540829a8",
"/index.js.map": "/index.js.map?id=e2f5e7c9722e176129d1"
}
2 changes: 1 addition & 1 deletion 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.1.8",
"version": "1.1.9",
"author": "[email protected]",
"license": "MIT",
"main": "lib/index.js",
Expand Down
6 changes: 3 additions & 3 deletions src/VdtnetTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,10 @@ export default {
const jq = vm.jq
const $el = jq(vm.$refs.table)
// console.log(vm.options.buttons)
vm.dataTable = $el.DataTable(vm.options)
vm.$emit('table-creating', vm)
// you can access and update the vm.options and $el here before we create the DataTable
vm.$emit('table-creating', vm, $el)
vm.dataTable = $el.DataTable(vm.options)
if (vm.selectCheckbox) {
// handle select all checkbox
$el.on('click', 'th input.select-all-checkbox', (e) => {
Expand Down

0 comments on commit ec5d937

Please sign in to comment.