How is possible to know or get event on focus on child table

To log on change , Frappe is provide the way like this.

frappe.ui.form.on("Purchase Invoice Item", {
    expense_account(frm, cdt, cdn) {
        var d = locals[cdt][cdn];
        console.log('d', d)

any solution if we want get event just on focus on input of child table item?

Hi @treeem,

Please apply it.

frappe.ui.form.on("Purchase Invoice Item", {
    expense_account: function(frm, cdt, cdn) {
        var d = locals[cdt][cdn];
        console.log('d', d.expense_account)

Then reload and check it.

Thank You!

Thanks @NCP , But what I am trying to achieve is to detect when use focus on the input event on that the child table fields.
I found the core file is of frappe framework,

this.$input.on("focus", function () {
			setTimeout(function () {
				if (me.$input.val() && me.get_options()) {
					let doctype = me.get_options();
					let name = me.get_input_value();
					me.$link_open.attr("href", frappe.utils.get_form_link(doctype, name));

				if (!me.$input.val()) {

					// hide link arrow to doctype if none is set
			}, 500);

how we could bring ,override or extend this to our custom js script?


1 Like