I updated it this way, but the background color does not appear in excel.
It appears on the screen as a style.
Do I need to update the export method?
I'm using version 6, do I need to update to version 9?
,{title:'Tarih',dataIndx:'Tarih',dataType:'date',minWidth:24,width:85,cls:'',clsHead:'',align:'',halign:'center',hidden:false,editable:false
,editor:{attr:'type="date" autofocus'},format:'dd/mm/yy',formatRaw:'yy-mm-dd',formatSel:'yy-mm-dd'
,filter:{crules: [{ condition:'between'}],menuIcon:false}
,render:function (ui) {return {attr:'title="'+ui.cellData+'"', style :"background-color:"+ui.rowData['ColorCode']+";" } }
}
headItems function:
{
name: 'Save AS',
icon: 'ui-icon ui-icon-extlink',
subItems: [{
name: 'Print',
action: function () {
console.log(this);
var exportHtml = this.exportData({ title: 'Print', format: 'htm', render: true }),
newWin = window.open('', '', 'width=1200, height=700'),
doc = newWin.document.open();
doc.write(exportHtml);
doc.close();
newWin.print();
}
},
{
name: 'Excel',
action: function(){
exportData.call(this, 'xlsx');
}
},
{
name: 'Csv',
action: function(){
exportData.call(this, 'csv');
}
},
{
name: 'Html',
action: function(){
exportData.call(this, 'html');
}
},
{
name: 'Json',
action: function(){
exportData.call(this, 'json');
}
}
]
},
exportData function:
function exportData(format){
var blob = this.exportData({
format: format
})
if(typeof blob === "string"){
blob = new Blob([blob]);
}
saveAs(blob, "Portal."+ format );
}