How to hide ‘status’ from list view
before:
frappe.listview_settings['Purchase Invoice'] = {
onload(listview) {
listview.columns = listview.columns.filter(column => {
if (column.df && column.df.fieldname === 'posting_date') {
return false;
}
return true;
});
$(document).ready(function() {
$('div.list-row-col.hidden-xs').filter(function() {
return $(this).text().trim() === 'Date';
}).hide();
});
}
};
after the code
i did something like this to hide date,
you can try this
1 Like
@Sudhanshu Good job! at least we can use it as a workaround…
For me, this worked!
onload(listview) {
listview.columns = (listview.columns || []).filter(col =>
col && col.df && col.df.fieldname !== 'docstatus'
);
$(document).ready(function() {
$('div.list-row-col.hidden-xs').filter(function() {
return $(this).text().trim() === 'Status';
}).hide();
});
},
2 Likes
Thank you for sharing.
I also wrote this on refresh hook.
refresh: function(listview) {
// Find 'Status' header
let status_header_index = -1;
listview.$result.find('.list-row-head .list-row-col').each(function(index) {
if ($(this).text().trim() === 'Status') {
status_header_index = index;
$(this).hide();
return false;
}
});
if (status_header_index > -1) {
listview.$result.find('.list-row').each(function() {
$(this).find('.list-row-col').eq(status_header_index).hide();
});
}