I have a grid that fetches paged data from a remote data source. I have implemented a new directive, remoteGridDataBinding , that extends the GridDataBindingDirective to handle this and it works great. This directive implements the fetchRemoteData function which encapsulates all the logic required to retrieve the data from my remote service.
I'm now looking to implement the Export to Excel functionality. I understand that I can use the fetchData binding on the kendo-grid-excel component. I can then pass this an observable containing all the data.
Is there anyway my getAllData function can make use of the fetchRemoteData function within my new databinding directive?
Otherwise I would need to implement the logic for retrieving the grid's data twice. This may not seem like too much overhead initially but our application has a number of grids that would need to implement this functionality. It would be a cleaner if we could implement the remote data source call once (within a reusable directive), and then reuse this logic when I need to fetch all the grid's data before an export to excel.