Managed to fix this myself after a bit of R&D. Posting complete code below (please excuse formatting)
function exportSecondGrid(workbook) {
var headerArr = [];
$.ig.GridExcelExporter.exportGrid($("#grid1"), {
fileName: "igGrid",
worksheetName: "Sheet2"
},
{
headerCellExporting: function(sender, args) {
// We will save all the headers coming to our array for retrieval later on
headerArr.push(args.headerText);
if (args.columnIndex === 0) {
sender._workbook = workbook;
sender._workbook.worksheets().add( sender._worksheet.name());
sender._worksheet = sender._workbook.worksheets(1);
}
},
exportEnding: function(sender, args) {
// Now use the array of headers to be updated
var row = sender._worksheet.rows(0);
for(var ind=0; ind < headerArr.length; ind++) {
row.setCellValue(ind, headerArr[ind]);
}
}
}
);
}
Use this with the original first function and everything will be perfect