Tree view customize in frappe

In tree view, in a node i have a checkbox is the checkbox is clicked. I need to change the title in the node displayed in tree view…

here instead of flyover bridge i need to get Disabled in place of title…

@SUDHAN a little unclear about your requirement. What is the issue? What do you want to change the title to? and which title?

In tree view i need to display disabled if the entry was disabled

{value: “Bridges”, title: “Bridges”, expandable: 1}

here if i update the title it display Disabled

frappe.treeview_settings[“Docname”] = {
onrender(node) {
let page = $(document);
if(!node.is_root) {
frappe.db.get_value(“Docname”, node.data.value, “fieldname”)
.then((r) => {
if(r.message.fieldname){
let x = page.find(span[data-label="${node.data.value}"] .tree-label span.text-muted);
x.text( ${ x.text() } ( Disabled ));
}
})
}
}
}

1 Like

Thanks @SUDHAN. Really useful!

1 Like