Good day,
I need to customize an existing doctype in the LMS app. I need to add button of “add multiple” beside “add row” , similar to the one in the Doctype table of Sales Order Item as per the below screenshot attached and highlighted in red.
I also need to understand, how and where to add this (add multiple) in any Doctype table and what what exact code triggers it and where to find it.
Thanks and Regards,
use this JS script as an example
frappe.ui.form.on('Unit Block', {
onload_post_render: function(frm) {
frm.get_field("unit_block_table").grid.set_multiple_add("unit");
frm.refresh_field('unit_block_table');
}
});
Hi,
Thanks for answering my question. I did make it work. Just wondering if you could also provide links of doc/tutorials or samples on how to customize the popup form that opens when you click the “add multiple”
I am trying to add search filters and change the listing to a table view which i can tick a box before the item and maybe add paginations instead of “more”.
Once again thank you so much.
@Francis_Igtanloc
The form is a default template and gets rendered based on the parameters provided in the set_multiple_add function.
You won’t be able to get a table view here but the list view allows clicking on the row and it by default gets added to the child table in the main doctype.