Hide List View Dropdown Button in Doctype

I want to Hide List View dropdown button for a custom Doctype for a user.

Hi @Pradeep_Manoharan:

Add this on listview client script …

$('.custom-btn-group').hide()

Hope this helps.

Hi @avc

I have added this code on Client Script.
frappe.listview_settings[‘Property’] = {
onload: function (listview) {
$(‘.custom-btn-group’).hide()

}

};
it’s not working

Hi @Pradeep_Manoharan:

Try with refresh event instead onload

frappe.listview_settings['Property'] = {
    refresh: function(listview) {
            $('.custom-btn-group').hide();
    }
}

Or add some sleep, sometimes it works even with 0 ms delay …
This kind of DOM “exorcism” is really depending on timing …

frappe.listview_settings['Property'] = {
    onload: function(listview) {
        setTimeout(function() {
            $('.custom-btn-group').hide();
        }, 0); // set your timeout in ms
    }
}

Hope this helps.

2 Likes

Hi @avc

It Works :wink:.Thank You.