After exploring various suggestions on stackoverflow related to my question, I have not been successful.
My current challenge involves implementing server-side pagination in UI-GRID. I am specifically struggling with exporting all data as a CSV file.
Due to the size of my data, I am displaying only 25 records upon initial loading. As the user navigates through pages, a query is submitted to retrieve the next 25 records from the database.
Is there an event that can be triggered to export all data as a CSV file? This would enable me to interact with the controller and fetch the complete dataset.
https://i.sstatic.net/5HKWk.jpg
Here is a snippet of code related to pagination:
gridApi.pagination.on.paginationChanged($scope, function(newPage, pageSize) {
paginationOptions.pageNumber = newPage;
paginationOptions.pageSize = pageSize;
CommonService.getStudents("../login/loadValues",
paginationOptions)
.then(function(data) {
$scope.ListOption.data = data;
$scope.ListOption.totalItems = data[0].count;
});
});
I am seeking a similar event trigger mechanism for exporting all data as CSV. Any suggestions or insights would be greatly appreciated.