I am using Vaadin-grid version 3.0.2 and i have refresh problem. I have a back button on the view. When user hits back button, I would like to redraw vaadin-grid. Below is the my code to do it.
Detail-view with back button:
Back To Search
_goToSearch: function () {
window.history.back();
return false;
},
when user click on back button, serach view displays only one row. When user resize page, all the rows will be displayed.
is there any other way to refresh grid?
Hi, you can refresh the grid by triggering resize manually like this:
document.getElementById(‘grid’).notifyResize();
And if you are using data-provider instead of items array, you can also clear the cached pages and reload data from it like this:
document.getElementById(‘grid’).clearCache();
BTW, please pay attention to document.getElementById is not the right way to get reference to the element which is inside of any other element’s Shadow Root.