Hi,
I have the following grid...
$("#grid").kendoGrid({
toolbar: ["excel"],
excelExport: function (e) {
e.workbook.fileName = "Test.xlsx";
e.workbook.sheets[0].title = 'Hello World';
var rows = e.workbook.sheets[0].rows;
e.workbook.sheets[0].rows.unshift({
cells: [
{
value: ''
}
],
});
e.workbook.sheets[0].rows.unshift({
cells: [
{
value: 'Football: ' + $('input[name=mnuFoot]:checked').val(),
bold: true
}
],
});
e.workbook.sheets[0].rows.unshift({
cells: [
{
value: 'Soccer: ' + $('input[name=mnuSoccer]:checked').val(),
bold: true
}
],
});
for (var ri = 0; ri < rows.length; ri++) {
var row = rows[ri];
if (row.type == "group-footer" || row.type == "footer") {
for (var ci = 0; ci < row.cells.length; ci++) {
var cell = row.cells[ci];
if (cell.value) {
//Use jQuery.fn.text to remove the HTML and get only the text
cell.value = $(cell.value).text();
//Set the alignment
cell.hAlign = "right";
}
}
}
}
},
......
How can I export the data using the same functionality as the button on the toolbar using a button outside of the grid?
Thanks,
Liem