Hi Matias,
Greetings from Syncfusion forum.
We have validated and achieved your requirement using excelQueryCellInfo and getDateFormat method based on our assumptions.
Query: it possible to set a cell on a specific type?
Yes, wou can set column in specific type using ‘type’ property in column level.
We have applied the “Applied” Column as in HH: mm Custom format and are shown in that format. The getDateFormat method that returns a function that formats a date object based on the specified DateFormatOptions. Using this format in excelQueryCellInfo, we can export the value as in text with corresponding format options. Using this text value we can perform whatever we want.
Reference links.
Please refer to the below code and sample link.
var intl = new ej.base.Internationalization()
var grid = new ej.grids.Grid({
dataSource: data,
allowExcelExport: true,
.. . . .
columns: [
. . . .
{
field: "Applied",
headerText: "Order Date",
width: 130,
format: {type:'date', format:'HH:mm'},
textAlign: "Right"
}
],
excelQueryCellInfo: function(e) {debugger;
if(e.column.field === 'Applied'){
var format = e.column.format;
var intl = new ej.base.Internationalization();
var dFormatter = intl.getDateFormat(format);
e.value = dFormatter(e.value);
console.log(e.value); // returns text value
}
}
});
grid.appendTo("#Grid");
|
Still, facing the issue please share the below details.
- Structural view of your dataSource
- Pictorial representation of your requirement.
- Explain your requirement briefly.
Please get back to us, if you need any further assistance.
Regards,
Balaji Sekar.