i tried somthing like that in my cutom app but not worked
import NumberCardWidget from "../../../../frappe/frappe/public/js/frappe/widgets/number_card_widget";
NumberCardWidget.prototype.set_body = function () {
console.log("set_body custom π-------------------------------------");
this.widget.addClass("number-widget-box");
this.make_card();
};
and still the app call origibnal method set_body
many thanks pro for your help
i can overide the stander method only if it accessible through js namespace like
frappe.ui.form.CustomerQuickEntryForm = PartyQuickEntryForm;
frappe.ui.form.SupplierQuickEntryForm = PartyQuickEntryForm;
and its working ok
but i wnat to overide for class not linked with namesapece like the βNumberCardWidgetβ
import Widget from "./base_widget.js";
frappe.provide("frappe.utils");
export default class NumberCardWidget extends Widget {
constructor(opts) {
opts.shadow = true;
super(opts);
}
get_config() {
return {
name: this.name,
number_card_name: this.number_card_name,
label: this.label,
color: this.color,
hidden: this.hidden,
};
}
and to acess it you have to acess through the file path also
this code will work if i but it in any frappe js stander js file βfrappe/public/jsβ
import NumberCardWidget from "../../../../../frappe/frappe/public/js/frappe/widgets/number_card_widget";
NumberCardWidget.prototype.set_body = function () {
console.log(
"set_body custom π-----------s---from inside---zzzzzddzzzzszz--------------------"
);
this.widget.addClass("number-widget-box");
this.make_card();
};
but the issue that my cutom app will have seprate bundle so i think this the reson its not working