refresh api can now update columns
This commit is contained in:
parent
dbed415ff3
commit
b3f281b214
9
dist/frappe-datatable.cjs.js
vendored
9
dist/frappe-datatable.cjs.js
vendored
@ -853,10 +853,13 @@ class DataManager {
|
|||||||
this.filterRows = promisify(this.filterRows, this);
|
this.filterRows = promisify(this.filterRows, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
init(data) {
|
init(data, columns) {
|
||||||
if (!data) {
|
if (!data) {
|
||||||
data = this.options.data;
|
data = this.options.data;
|
||||||
}
|
}
|
||||||
|
if (columns) {
|
||||||
|
this.options.columns = columns;
|
||||||
|
}
|
||||||
|
|
||||||
this.data = data;
|
this.data = data;
|
||||||
|
|
||||||
@ -3420,8 +3423,8 @@ class DataTable {
|
|||||||
this.toastMessage = $('.toast-message', this.wrapper);
|
this.toastMessage = $('.toast-message', this.wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
refresh(data) {
|
refresh(data, columns) {
|
||||||
this.datamanager.init(data);
|
this.datamanager.init(data, columns);
|
||||||
this.render();
|
this.render();
|
||||||
this.setDimensions();
|
this.setDimensions();
|
||||||
}
|
}
|
||||||
|
|||||||
9
dist/frappe-datatable.js
vendored
9
dist/frappe-datatable.js
vendored
@ -852,10 +852,13 @@ class DataManager {
|
|||||||
this.filterRows = promisify(this.filterRows, this);
|
this.filterRows = promisify(this.filterRows, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
init(data) {
|
init(data, columns) {
|
||||||
if (!data) {
|
if (!data) {
|
||||||
data = this.options.data;
|
data = this.options.data;
|
||||||
}
|
}
|
||||||
|
if (columns) {
|
||||||
|
this.options.columns = columns;
|
||||||
|
}
|
||||||
|
|
||||||
this.data = data;
|
this.data = data;
|
||||||
|
|
||||||
@ -3419,8 +3422,8 @@ class DataTable {
|
|||||||
this.toastMessage = $('.toast-message', this.wrapper);
|
this.toastMessage = $('.toast-message', this.wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
refresh(data) {
|
refresh(data, columns) {
|
||||||
this.datamanager.init(data);
|
this.datamanager.init(data, columns);
|
||||||
this.render();
|
this.render();
|
||||||
this.setDimensions();
|
this.setDimensions();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -852,10 +852,13 @@ class DataManager {
|
|||||||
this.filterRows = promisify(this.filterRows, this);
|
this.filterRows = promisify(this.filterRows, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
init(data) {
|
init(data, columns) {
|
||||||
if (!data) {
|
if (!data) {
|
||||||
data = this.options.data;
|
data = this.options.data;
|
||||||
}
|
}
|
||||||
|
if (columns) {
|
||||||
|
this.options.columns = columns;
|
||||||
|
}
|
||||||
|
|
||||||
this.data = data;
|
this.data = data;
|
||||||
|
|
||||||
@ -3419,8 +3422,8 @@ class DataTable {
|
|||||||
this.toastMessage = $('.toast-message', this.wrapper);
|
this.toastMessage = $('.toast-message', this.wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
refresh(data) {
|
refresh(data, columns) {
|
||||||
this.datamanager.init(data);
|
this.datamanager.init(data, columns);
|
||||||
this.render();
|
this.render();
|
||||||
this.setDimensions();
|
this.setDimensions();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,10 +14,13 @@ export default class DataManager {
|
|||||||
this.filterRows = promisify(this.filterRows, this);
|
this.filterRows = promisify(this.filterRows, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
init(data) {
|
init(data, columns) {
|
||||||
if (!data) {
|
if (!data) {
|
||||||
data = this.options.data;
|
data = this.options.data;
|
||||||
}
|
}
|
||||||
|
if (columns) {
|
||||||
|
this.options.columns = columns;
|
||||||
|
}
|
||||||
|
|
||||||
this.data = data;
|
this.data = data;
|
||||||
|
|
||||||
|
|||||||
@ -73,8 +73,8 @@ class DataTable {
|
|||||||
this.toastMessage = $('.toast-message', this.wrapper);
|
this.toastMessage = $('.toast-message', this.wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
refresh(data) {
|
refresh(data, columns) {
|
||||||
this.datamanager.init(data);
|
this.datamanager.init(data, columns);
|
||||||
this.render();
|
this.render();
|
||||||
this.setDimensions();
|
this.setDimensions();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -76,7 +76,7 @@ export default class RowManager {
|
|||||||
for (let rowIndex in this.checkMap) {
|
for (let rowIndex in this.checkMap) {
|
||||||
const checked = this.checkMap[rowIndex];
|
const checked = this.checkMap[rowIndex];
|
||||||
if (checked === 1) {
|
if (checked === 1) {
|
||||||
out.push(rowIndex)
|
out.push(rowIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user