mirror of
https://github.com/frappe/books.git
synced 2024-12-23 11:29:03 +00:00
add getRows method in reportpage
This commit is contained in:
parent
a85490eeae
commit
a19833f325
@ -10,7 +10,7 @@ const Observable = require('frappejs/utils/observable');
|
|||||||
// `getColumns` return columns
|
// `getColumns` return columns
|
||||||
|
|
||||||
module.exports = class ReportPage extends Page {
|
module.exports = class ReportPage extends Page {
|
||||||
constructor({title, filterFields}) {
|
constructor({title, filterFields = []}) {
|
||||||
super({title: title, hasRoute: true});
|
super({title: title, hasRoute: true});
|
||||||
|
|
||||||
this.fullPage = true;
|
this.fullPage = true;
|
||||||
@ -30,6 +30,10 @@ module.exports = class ReportPage extends Page {
|
|||||||
// overrride
|
// overrride
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getRowsForDataTable(data) {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
makeFilters() {
|
makeFilters() {
|
||||||
this.form = new Form({
|
this.form = new Form({
|
||||||
parent: this.filterWrapper,
|
parent: this.filterWrapper,
|
||||||
@ -79,14 +83,16 @@ module.exports = class ReportPage extends Page {
|
|||||||
method: this.method,
|
method: this.method,
|
||||||
args: filterValues
|
args: filterValues
|
||||||
});
|
});
|
||||||
this.datatable.refresh(data);
|
|
||||||
|
const rows = this.getRowsForDataTable(data);
|
||||||
|
this.datatable.refresh(rows);
|
||||||
}
|
}
|
||||||
|
|
||||||
makeDataTable() {
|
makeDataTable() {
|
||||||
this.datatable = new DataTable(this.tableWrapper, {
|
this.datatable = new DataTable(this.tableWrapper, Object.assign({
|
||||||
columns: utils.convertFieldsToDatatableColumns(this.getColumns(), this.layout),
|
columns: utils.convertFieldsToDatatableColumns(this.getColumns(), this.layout),
|
||||||
data: [],
|
data: [],
|
||||||
layout: this.layout || 'fluid',
|
layout: this.layout || 'fluid',
|
||||||
});
|
}, this.datatableOptions || {}));
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user