I would like to know if there is any way to remove or hide the “status” and “id” filing from the view list.
Hii @Talita.Mangolin
To display your required fields in a list view, you can set the fields you want:
I hope it works for you,
thank you
You can’t remove the ID from the Listview Settings,
If you want to remove the ID then you have to apply the Listview client script.
frappe.listview_settings["DocType"] = {
hide_name_column: true
};
Thank you so much, you’re the best. It worked perfectly
One more question, to hide the listview comment icon, I’m using the following code:
$(“.comment-count”).hide();
But it didn’t work in v14.
complete code:
frappe.listview_settings[‘Opportunity’] = {
refresh: function(listview) {
$(“div[data-fieldname = name]”).hide();
$(“.comment-count”).hide();
$(“use.like-icon”).hide();
},
hide_name_column: true
};
Any one can help me hide the status field in list view.
Finally found solution!!!
frappe.listview_settings[‘DocType’] = {
hide_name_column: true, // hide ID column
onload: function(listview) {
hideElements();
}
};
function hideElements() {
// hide status element
document.querySelectorAll(“.list-row-col.ellipsis.hidden-xs”).forEach((el) => {
if (el.innerText.trim() === “Status”) {
el.classList.add(“hide”);
}
});
document.querySelectorAll(“.list-row-col.hidden-xs.ellipsis”).forEach((el) => {
const text = el.innerText.trim();
if ([“Draft”, “Submitted”, “Cancelled”].includes(text)) {
el.classList.add(“hide”);
}
});
// hide like column
document.querySelectorAll(“.level-right”).forEach((el) => {
el.classList.add(“hide”);
});
}
// Monitor the DOM for changes and reapply the class when needed
const observer = new MutationObserver(() => {
hideElements();
});
observer.observe(document.body, {
childList: true,
subtree: true
});
Thank me later!