I created constructor that I cloned from apps\frappe\frappe\public\js\frappe\roles_editor.js.
I success implemented it in study_program_editor.js. But, when I copied and make new constructor file (entry_status_editor.js), I got an error
Uncaught (in promise) TypeError: frappe.EntryStatusEditor is not a constructor
I have rebuild the project, restart bench, but it is still error.
I attached my script
frappe.EntryStatusEditor = class {
constructor(wrapper, frm, disable, is_new, doc_child) {
this.frm = frm;
this.wrapper = wrapper;
this.disable = disable;
this.doc_child = doc_child;
let user_status = is_new ? new Array() : this.frm.doc.entry_status.map(a => a.entry_status);
this.multicheck = frappe.ui.form.make_control({
parent: wrapper,
df: {
fieldname: "entry_status",
fieldtype: "MultiCheck",
select_all: true,
columns: 3,
get_data: () => {
return frappe.xcall('frappe.core.doctype.user.user.get_all_entry_status').then(status => {
return status.map(stat => {
return {
label: stat['status_code']+' - '+stat['status_name'],
value: stat['status_code'],
checked: user_status.includes(stat['status_code'])
};
});
});
},
on_change: () => {
this.set_status_in_table();
this.frm.dirty();
}
},
render_input: true
});
}
show() {
this.reset();
}
}