frappe.web_form.on(‘additional_item’, ‘select_item’, (web_form, cdt, cdn) => {
let row = locals[cdt][cdn]; // Access the row of the child table
console.log(“Select item triggered for row:”, row);
// You can add further logic here
});
additional_item is my childe table and i want to print messages when click on child table filed * select_item*
Solution :
frappe.web_form.after_load = () => {
// Access the child table ‘items’
frappe.web_form.fields_dict[‘items’].grid.wrapper.on(‘click’, ‘.grid-row’, function(event) {
let $row = $(this);
// Check if the item_code field was clicked
if ($row.find(‘[data-fieldname=“item_code”]’).length) {
frappe.msgprint({
title: __(‘Alert’),
message: __(‘You clicked on the item code field.’),
indicator: ‘blue’
});
}
});
};