How to add foo_list.js?

It is already asked but I don’t get exact solution so I am asking.

I have created a app name ‘bla’ and added a doctype name ‘Foo’. I need to do soming in list view. In bla->doctype->foo, foo_list.js was not created so I create foo_list.js there and add some code. But its is not reflected in list view. Am I missing any step ?

can you share your code pls.

This code is in foo_list.js

frappe.listview_settings['Foo'] = {
    refresh: function (doc) {
        console.log("frappe.listview_settings[Foo] ");
    }
};

your code seems fine. Probably the naming?

Selection_068

Do we have the same name format?

Yes, naming is correct. Do I need to do anything in hooks.py?

No you dont. Have you checked the console?

Does this print console.log("frappe.listview_settings[Foo] ");

try with “onload” in place with “refresh” because in my case refresh not called but onload is working fine.
Hope this will help you.

frappe.listview_settings['Foo'] = {
    onload: function (doc) {
       console.log("frappe.listview_settings[Foo] ");
    },
};