How can i create a toggle button in list_view for any doctype

Hi today i have two buttons for a doctype there one for upload and there for download but when i enable any button among them then it show only one or when i change the view from list to report or any other then it don;t show any data. What should i do for it. here i mention images for this


i want to create a drop down button and a condition behalf of view.

Hi, You have to apply the logic using the listview js.

It will be easier to debug if you share some of the code you have written.
TO add button as dropdown…

list_view.page.add_inner_button('Approved', () => show_approved(), 'Status')
list_view.page.add_inner_button('Unapproved', () => show_unapproved()`, 'Status')

Reference…
https://frappeframework.com/docs/user/en/api/page#pageadd_inner_button


i has this point. i create that bulk print button there but i want to create one more button to for another functionality and a condition when i apply list view then it buttons will show otherwise not.

if(list_view.page.title != "Sales Invoice"){
    // your code 
}

try this

No It’s not

i need to apply condition on the switching of views … like button work for listview or when i switch it to the report view then it disable that button.