frappe.ui.form.on(cur_frm.doctype, {
'onload_post_render': function(frm, cdt, cdn) {
frm.fields_dict.items.grid.wrapper.on('click', 'input[data-fieldname="item_code"][data-doctype="Sales Invoice Item"]', function(e) {
console.log(e);
var d = locals[cdt][cdn];
msgprint(d.item_code); //it showed me all item codes in the grid
});
}
});
How to get active / focused row when it’s clicked?
The case is … I want to get price value when user click the price on the popup then update rate field in the grid for that item…do you have some hints how to do that? It will be so helpful for others too…
We had to make on demand backups so we made a popup with behavior. I have used id selector for download all button on the $wrapper. Instead, give a data attribute to select and assign onclick event on all the list items, and access the attribute through this variable- which points to the list item.
Assigning that value to the selected doc row should be pretty much straight.