Skip to content

Commit

Permalink
Xlsx export issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mcop1 committed Aug 29, 2024
1 parent 11601dc commit 461e5b6
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions src/Resources/public/js/searchConfig/resultPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ pimcore.bundle.advancedObjectSearch.searchConfig.resultPanel = Class.create(pimc
var jobs = [];

var fields = this.getGridConfig().columns;
var fieldKeys = Object.keys(fields);
var fieldKeys = this.mapRequestParameter(fields);

//create the ids array which contains chosen rows to export
var ids = [];
Expand Down Expand Up @@ -509,7 +509,7 @@ pimcore.bundle.advancedObjectSearch.searchConfig.resultPanel = Class.create(pimc
var rdata = Ext.decode(response.responseText);

var fields = this.getGridConfig().columns;
var fieldKeys = Object.keys(fields);
var fieldKeys = this.mapRequestParameter(fields);

if (rdata.success && rdata.jobs) {
this.exportProcess(rdata.jobs, rdata.fileHandle, fieldKeys, true, settings, exportType);
Expand All @@ -519,6 +519,24 @@ pimcore.bundle.advancedObjectSearch.searchConfig.resultPanel = Class.create(pimc
});
},

mapRequestParameter: function(fields )
{
var fieldKeys = Object.keys(fields);
var fieldKeys2 = [];
for(var i = 0; i < fieldKeys.length; i++) {
var field = fields[fieldKeys[i]];
if(!field.hidden) {
var fc = {
key: fieldKeys[i],
label: field.fieldConfig.label,

};
fieldKeys2.push(fc);
}
}
return JSON.stringify(fieldKeys2);
},

openColumnConfig: function () {
var fields = this.getGridConfig().columns;

Expand Down

0 comments on commit 461e5b6

Please sign in to comment.