How to Hide the ID Column in the Address DocType List View

Hi everyone,

I’m trying to hide the ID (name) column in the Address DocType list view. I’m using the following client script to achieve this, but it’s not working as expected.

Here’s the code I’m using:

frappe.listview_settings[‘Address’] = {
hide_name_column: true // Attempting to hide the ID (name) column
};

It doesn’t seem to have any effect, and the ID column is still visible. Could anyone point out what mistake I might have made or suggest a solution to hide this column?

Thanks in advance for your help

Hi @Sanmugam

Check it out

@Sanmugam Just wanted to note that the above/ below code in doctype_name_list.js will only work if the Doctype has a title field set

frappe.listview_settings["Address"] = {
     hide_name_column: true
};

adding @ShubhamKaushik, if you apply on client script doctype then

@NCP According to me we can use the following approach::

Approach 1: Use Custom CSS to Hide the ID Column

.list-id-column {
    display: none;
}

Approach 2: Using JavaScript in a Custom App or HTML Page (Not Client Script)

frappe.listview_settings['Address'] = {
    onload: function(listview) {
        // Hide the ID (name) column
        $(document).ready(function() {
            $('th:contains("ID"), td:contains("ID")').hide();  // Adjust this selector as needed
        });
    }
};

@NCP It’s not working as expected. In the list code, both the checkbox and the ID header are contained within the same div. The root class is level-item. If I hide the level-item, it hides both the input and the span tags. How can I hide only the ID?

frappe.listview_settings[‘Address’] = {
refresh: function(listview) {
$(“.span.level-item”).hide();
$(“.bold”).hide();
}
};