Hello,
i am currently using the data manager for sever side filtering, sorting and paging.
I would like to store the result of those requests in a vuex store.
The reason is, that i have anoter component for editing an entrie that was selected in the grid and i don't want to refresh the whole grid after updating an entry in order to show the updated data in the grid.
Hopefully nobody worked on that, yet. I found a solution by myself. I just Added a dataStateChanged Method which uses axios to send the request to my api (with grid state in body) so the DataManagerRequst can do the work.
But there is still one problem i am facing. As i said i have another component that shows details for the selected items with the possibility to change their properties.
After updating an item i search it's index in the array (which the grid uses as datasource) and replace it with the updated item.
The changes dont get reflected in the grid so i added a watcher to refresh columns:
My problem now is, that the commented line will lead into an infinite loop of fetching data from the api and refreshing grid columns. (refreshGridColumns() triggers reload from api, which updates my store, which triggers my watcher, and so on).
Is there any way to make the grid rerender updated columns in order to show the correct data without reloading the whole grid from api?
watch: {
media: {
handler() {
if (this.isChanged) {
this.isChanged = false;
this.$refs.Grid.refreshColumns();
}
}
}
} |