简体   繁体   中英

AG-GRID Excel Export: Is there any way in AG-Grid to configure Records Export Limit per user?

Is there any way to to restrict Excel Export limit from AG-Grid, so that only allowed number of rows can be exported by a User.

For an Example, if Grid is showing 75,000 Records, can we limit Excel to export only 10,000 (or any configurable number) records ?

Not per configuration, no. But you can implement this functionality yourself as one of the exportparams for

gridOptions.api.exportDataAsExcel(exportParams);

is a callback function shouldRowBeSkipped .

So a possible implementation would look something like this (not tested):

var exportedRows = 0;

var exportParams = {
  shouldRowBeSkipped: function(params) {
    exportedRows++;
    return exportedRows <= 10000;
  }
};

gridOptions.api.exportDataAsExcel(exportParams);

Have a look at all the export params: https://www.ag-grid.com/javascript-grid-export/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM