私の問題は、現在のページのデータだけでなく、外部のページネーションですべてのデータをcsvにエクスポートする方法です
以下のコントローラーとビューのコードを見つけることができます。
私のHTML:
<div class="pull-right">
<button class="btn btn-xs btn-default" type="button" ng-click="downloadCSV()">{{exportBtn}}</button>
</div>
私のJS:
グリッドの準備で私は持っています:
...
enableSelectAll: true,
exporterCsvFilename: config.csvFileName,
exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")),
exporterHeaderFilter : $translate.instant,
//Here is my downloadCSV function
scope.downloadCSV = function () {
if(scope.gridApi && scope.gridApi.exporter) {
scope.gridApi.exporter.csvExport(uiGridExporterConstants.ALL,uiGridExporterConstants.ALL);
}
};
アップデート :
gridOptions.data
調査の結果、現在のページのデータしか取得していないことがわかりました。
scope.gridOptions.data = data.response.docs;// here i have 20 records
scope.gridOptions.totalItems = data.response.numFound; // number is 50
ページングがあり、ページごとに 20 レコードを表示しています。したがって、エクスポータはグリッドで 20 レコードしか表示せず、エクスポートのみを行います..では、これらの場合、どのようにすべてのデータをエクスポートできますか?