2
0
mirror of https://github.com/frappe/books.git synced 2024-09-20 19:29:02 +00:00
books/client/desk/listpage.js

19 lines
468 B
JavaScript
Raw Normal View History

2018-02-08 09:38:47 +00:00
const frappe = require('frappejs');
2018-01-30 12:03:04 +00:00
const Page = require('frappejs/client/view/page');
const view = require('frappejs/client/view');
2018-02-08 09:38:47 +00:00
module.exports = class ListPage extends Page {
2018-01-30 12:03:04 +00:00
constructor(doctype) {
let meta = frappe.getMeta(doctype);
2018-02-08 09:38:47 +00:00
super(frappe._("List: {0}", meta.name));
this.list = new (view.getList_class(doctype))({
2018-01-30 12:03:04 +00:00
doctype: doctype,
2018-02-08 09:38:47 +00:00
parent: this.body,
page: this
2018-01-30 12:03:04 +00:00
});
2018-01-30 13:25:48 +00:00
this.on('show', async () => {
await this.list.run();
2018-01-30 12:03:04 +00:00
});
}
}