Skip to content

Commit

Permalink
reset() method added.
Browse files Browse the repository at this point in the history
  • Loading branch information
halillusion committed May 16, 2022
1 parent 37f8331 commit 1a133f6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,16 @@ You can trigger the KalipsoTable with the following setting block.
searchBar: true
}
};
new KalipsoTable(options);
const table = new KalipsoTable(options);
```
### API
#### Reset
If you want to reset the data table, you can use the **reset()** method.
```js
table.reset();
```
### Server-side and KalipsoTable PHP Class
Expand Down
14 changes: 12 additions & 2 deletions kalipso.table.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class KalipsoTable {
*/
constructor(options) {

this.version = '0.8.0';
this.version = '0.8.1';
this.loading = false;
this.result = [];
this.server = false;
Expand Down Expand Up @@ -74,11 +74,11 @@ class KalipsoTable {
{
"name": "5",
"value": 5,
"default": true
},
{
"name": "10",
"value": 10,
"default": true
},
{
"name": "50",
Expand Down Expand Up @@ -245,6 +245,16 @@ class KalipsoTable {
await this.prepareBody(true);
}

/**
* Reset Table
* @return void
*/
async reset() {
if (document.querySelector(this.selector)) {
await this.prepareBody(true);
}
}


/**
* Prepare sorting DOM.
Expand Down

0 comments on commit 1a133f6

Please sign in to comment.