Hi..
I'm customizing the boolean fields using template option in kendo column configuration and its working fine.but while doing export excel custom template is getting converted to boolean.
example : im having status column of type boolean/number,using template im displaying status as (Active/Inactive/pending).when i do export excel it is displaying as true/false in excel sheet.
Here is the example code with boolean type:
kendoProperties.addColumnConfiguration({
type: "boolean", sortable: false, field: "isPublished", title: "Publish Status", filterable: false,
template: "<label class=\"action-status#=isPublished#\">#= (isPublished == false) ? 'NOT PUBLISHED' : 'PUBLISHED' #</label>", width: "150px"
});
example code with number type:
Parser:
function parseDataForKendo(result) {
var data = [];
productionScheduleListVm.scheduleList = result.results;
var results = result.results;
for (var i = 0; i < results.length; i++) {
var schedule = {
status: results[i].schedule ? results[i].schedule.status : 0,
scheduleStatusClass: results[i].schedule.status ? resolveScheduleStatusCssClass(results[i].schedule.status) : null,
scheduleStatusText: results[i].schedule.status ? resolveScheduleStatusText(results[i].schedule.status) : null,
};
data.push(schedule);
}
return { "results": data, "totalResults": result.totalResults };
};
column config:
kendoProperties.addColumnConfiguration({
type: "number", sortable: true, hideWhenMinimize: true, field: "status", title: "Status", filterable: { cell: { template: statusFilter, showOperators: false }},
template: "<label class=\"schedule#=scheduleStatusClass# scheduleLabel\">#= (status == null) ? '-NA-' : scheduleStatusText# </label>"
});