Custom button in list view in version 15

I want to Add a custom button in in List View. Previously I added custom in Version14 using this code:

function ButtonFunction(listview) {
  console.log("ButtonFunction");
}

frappe.listview_settings["Item"] = {
  refresh: function (listview) {
    listview.page.add_inner_button("Button Name", function () {
      ButtonFunction(listview);
    });
  },
};

And in hooks.py

doctype_list_js = {"Item": "public/js/item_button.js"}

Now its not working in Version-15. How to make it work? How can I add custom button in list view in V15?

Did you migrate the site? if not then migrate the site. and also build the app (bench build --force).

Tested your code, so it’s worked properly.

2 Likes

@NCP, Thanks Man. Its Working now.