Add custom button to list view

Hello , can anyone help me with this issue , i want to add custom button in my custom doctype which navigate to sales invoice doctype ,

1 Like

hello, you can add a button group then add a custom button to that group like:

let myListButtonsGroup = cur_list.page.add_custom_button_group("My Group")

cur_list.page.add_custom_menu_item(myListButtonsGroup, "My Button", ()=>{
    console.log("works!")
});

if you want to add list action when selecting a row:

cur_list.page.add_actions_menu_item("My Action", () => {
    let selectedItems = cur_list.get_checked_items();

    // do something with the selected items
    for(let i=0; i < selectedItems.length; i++) {
        console.log("item selected: ", selectedItems[i])
    }
})
2 Likes

it worked, thanks so much sir appreciate that

2 Likes