I am working on refactoring an old app from Angular 1.2 to Vue.
I am using the Excel Export feature in the native grid successfully, however in the jQuery (and AngularJS) versions there is an "excelExport" event that we could hook into to modify the workbook prior to it being converted to an actual excel file. We were using this to conditionally apply background colors depending on the value of certain cells.
Here is an example of our old code:
excelExport:
function
(e) {
var
sheet = e.workbook.sheets[0];
var
statuses = _.object(_.map($scope.dataSource.StatusId,
function
(x) {
return
[x.id, { name: x.name, color: x.color }] }));
var
statusCol = findExcelColumn(sheet, "Status");
//find status column
if
(statusCol >= 0) {
//Set status display with colours
_.each(sheet.rows,
function
(row) {
var
value = row.cells[statusCol].value;
if
(!_.isUndefined(statuses[value])) {
row.cells[statusCol].background = statuses[value].color;
row.cells[statusCol].value = statuses[value].name;
}
});
}
},
Is this something that is still possible to do? If not, is it a planned feature?