Skip to content

Instantly share code, notes, and snippets.

@esafwan
Last active June 19, 2024 10:33
Show Gist options
  • Save esafwan/828b5fca8d3c5f2c41425cc09ab07608 to your computer and use it in GitHub Desktop.
Save esafwan/828b5fca8d3c5f2c41425cc09ab07608 to your computer and use it in GitHub Desktop.
Hide Childtable's row, disable checkbox
frappe.ui.form.on('Process File', {
onload: function(frm) {
frm.fields_dict['action'].grid.wrapper.find('.grid-row-check').hide();
frm.fields_dict['action'].grid.wrapper.find('.grid-header-row .grid-row-check').parent().hide();
// Disable row reordering
frm.fields_dict['action'].grid.cannot_be_reordered = true;
// Inject custom CSS to remove the entire checkbox column
$("<style>")
.prop("type", "text/css")
.html("\
.grid-row-check, \
.grid-header-row .grid-row-check, \
.grid-row .grid-row-check {\
display: none !important;\
}\
.grid-row, .grid-header-row {\
grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));\
}")
.appendTo("head");
},
refresh: function(frm) {
frm.fields_dict['action'].grid.wrapper.find('.grid-row-check').hide();
frm.fields_dict['action'].grid.wrapper.find('.grid-header-row .grid-row-check').parent().hide();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment