Skip to content

Commit

Permalink
Merge pull request #271 from pimcore/xlsx_export
Browse files Browse the repository at this point in the history
[Bug] Xlsx export issue
  • Loading branch information
mcop1 authored Aug 29, 2024
2 parents 11601dc + 461e5b6 commit e9cbb27
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 e9cbb27

Please sign in to comment.