Greetings! I have a set of grids to export to Excel. I completed the first, with the help of your fine demo apps.
I have quite a bit of code for the OnExcelExport(e) event to set Excel column widths, cell colors, etc. For example:
//Set column width and wrap text
if (colIndex == 0) {
row.cells[colIndex].wrap = true;
sheet.columns[colIndex].autoWidth = false;
sheet.columns[colIndex].width = 63;
}
if (colIndex == 5 || colIndex == 6 || colIndex == 7) {
row.cells[colIndex].wrap = true;
sheet.columns[colIndex].autoWidth = false;
sheet.columns[colIndex].width = 72;
}
My question is :Is there a way to store metadata in the column definition of the grid that I can read in OnExcelExport(e) so that I can create shared, generic functions to set the Excel attributes or must I code each grid like this (referencing column order, etc.)? I tried stuffing attributes in the clientTemplate but this always seemed to affect my HTML grid...
Best,
Scott