mirror of
https://github.com/frappe/books.git
synced 2024-11-10 07:40:55 +00:00
setValue method in formLayout
This commit is contained in:
parent
ddfd9a7e11
commit
30436ef256
@ -24,6 +24,7 @@ module.exports = class ReportPage extends Page {
|
||||
});
|
||||
|
||||
this.makeFilters();
|
||||
this.setDefaultFilterValues();
|
||||
}
|
||||
|
||||
getColumns() {
|
||||
@ -45,6 +46,10 @@ module.exports = class ReportPage extends Page {
|
||||
this.filterWrapper.appendChild(this.filters.form);
|
||||
}
|
||||
|
||||
setDefaultFilterValues() {
|
||||
|
||||
}
|
||||
|
||||
getFilterValues() {
|
||||
const values = {};
|
||||
for (let control of this.filters.controlList) {
|
||||
|
@ -317,6 +317,7 @@ module.exports = class BaseForm extends Observable {
|
||||
this.refresh();
|
||||
this.trigger('change');
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
frappe.ui.showAlert({message: frappe._('Failed'), color: 'red'});
|
||||
return;
|
||||
}
|
||||
|
@ -80,9 +80,19 @@ module.exports = class FormLayout extends Observable {
|
||||
this.controlList.forEach(control => {
|
||||
control.bind(this.doc);
|
||||
});
|
||||
|
||||
this.doc.on('change', ({doc, fieldname}) => {
|
||||
this.controls[fieldname].refresh();
|
||||
});
|
||||
|
||||
this.refresh();
|
||||
}
|
||||
|
||||
setValue(key, value) {
|
||||
if (!this.doc) return;
|
||||
this.doc.set(key, value);
|
||||
}
|
||||
|
||||
refresh() {
|
||||
this.controlList.forEach(control => {
|
||||
control.refresh();
|
||||
|
Loading…
Reference in New Issue
Block a user