ERPNext Foundation ERPNext Cloud User Manual Blog Discuss Frappé* Donate

Hide ‘Add row’ from child table


#1

Hi all,
i wanna hide the Add row button :disappointed_relieved:
i made all the child table read only but in vain


#2

this.frm.get_field("items").grid.cannot_add_rows = true;

This would disable the add_row button, although if you expand the row you’d still get a choice to insert above or insert below option.

this.frm.get_field("items").grid.only_sortable();

This will disable the add_row as well as the options inside the expanded row.


#3

Try this jQuery hack, which is for the “Delete” button in a child table. It’s the same logic as for the “Add Row” button. Or hide them both!

For the “Add Row” button…

hideTheButtonWrapper = $('*[data-fieldname="transfers"]');
hideTheButtonWrapper .find('.grid-add-row').hide();

… where “transfers” is the name of your child table.


DocType Button Color
#4

Why you want to remove add row option? Is the table pre-field?


#5

frappe.ui.form.on(“Sales Order”, “onload”,function(frm,cdt, cdn)
{

    $(".grid-add-row").hide();
       	
});

#6

i want to select data from time attendance device in this grid , and it is not logic to add row which is not in device


#7

This will hide all of the add rows in the child tables in the document. That’s probably not good for a document with more than one child table, like your example in Sales Order.


#8

cur_frm.set_df_property(“properties_list”, “read_only”, 1);

properties_list is your childtable field name… its working 100% please close this topic and mark as solution