List View refresh on button

I have created a custom script to submit work orders after making changes into each, the issue is that the list doesn’t get update on submit and I have to click on refresh button to get the list updated.


frappe.listview_settings['Work Order'] = {
	onload: function(listview) {
	    listview.page.add_action_item(__("Bulk Operation"), function() {
            //here I want to refresh the list
        });
}}

@avaiskhatri it should get updated if you do any changes somewhere else .frappe is using socketio and it’s listening to any changes happens. you can disable auto refresh from the list settings. if it’s not working you probably have something wrong with the port .

Try it.

frappe.listview_settings['Work Order'] = {
	onload: function(listview) {
	    listview.page.add_action_item(__("Bulk Operation"), function() {
            //here I want to refresh the list
            listview.refresh();
        });
}}