Keno spreadsheets are new and the documentation is very scarce.
I'm trying to do something relatively simple.
I have a spreadsheet with stylized headers like this:
this.sheetsHeader = [
{
name: "ProductsEntry",
rows: [
{
height: 15,
cells: [
{
value: "Name",
bold: "true",
background: "#00435e",
textAlign: "center",
color: "white",
fontSize: 14,
}, {
value: "Type",
bold: "true",
background: "#00435e",
textAlign: "center",
color: "white",
fontSize: 14,
},
{
value: "Currency",
bold: "true",
background: "#00435e",
textAlign: "center",
color: "white",
fontSize: 14,
},
{
value: "Rate",
bold: "true",
background: "#00435e",
textAlign: "center",
color: "white",
fontSize: 14
},
{
value: "StartDate",
bold: "true",
background: "#00435e",
textAlign: "center",
color: "white",
fontSize: 14,
}
]
}
],
columns: [
{ width: 200 },
{ width: 200 },
{ width: 90 },
{ width: 90 },
{ width: 110 }
]
}
];
and that gets initialized the normal way:
$("#spreadsheet").kendoSpreadsheet({
toolbar: false,
sheetsbar: false,
sheets: that.sheetsHeader
});
Then later I have an event that clears the spreadsheet but I want to leave the headers intact.
If I do this:
var sheet = spreadsheet.activeSheet();
sheet.range(kendo.spreadsheet.SHEETREF).clear();
It wipes out the headers and leaves the sheet entirely empty.
I tried re-adding the headers in many different ways but nothing worked for me.
Aftear clearing the spreadsheet I tried:
sheet.fromJSON(that.sheetsHeader[0].rows);
I also tried deleting the sheet and re-adding it:
spreadsheet.removeSheet(0);
spreadsheet.insertSheet(that.sheetsHeader);
Nothing really worked so far and there's no documentation for this sort of scenario. Any ideas?
I'm trying to do something relatively simple.
I have a spreadsheet with stylized headers like this:
this.sheetsHeader = [
{
name: "ProductsEntry",
rows: [
{
height: 15,
cells: [
{
value: "Name",
bold: "true",
background: "#00435e",
textAlign: "center",
color: "white",
fontSize: 14,
}, {
value: "Type",
bold: "true",
background: "#00435e",
textAlign: "center",
color: "white",
fontSize: 14,
},
{
value: "Currency",
bold: "true",
background: "#00435e",
textAlign: "center",
color: "white",
fontSize: 14,
},
{
value: "Rate",
bold: "true",
background: "#00435e",
textAlign: "center",
color: "white",
fontSize: 14
},
{
value: "StartDate",
bold: "true",
background: "#00435e",
textAlign: "center",
color: "white",
fontSize: 14,
}
]
}
],
columns: [
{ width: 200 },
{ width: 200 },
{ width: 90 },
{ width: 90 },
{ width: 110 }
]
}
];
and that gets initialized the normal way:
$("#spreadsheet").kendoSpreadsheet({
toolbar: false,
sheetsbar: false,
sheets: that.sheetsHeader
});
Then later I have an event that clears the spreadsheet but I want to leave the headers intact.
If I do this:
var sheet = spreadsheet.activeSheet();
sheet.range(kendo.spreadsheet.SHEETREF).clear();
It wipes out the headers and leaves the sheet entirely empty.
I tried re-adding the headers in many different ways but nothing worked for me.
Aftear clearing the spreadsheet I tried:
sheet.fromJSON(that.sheetsHeader[0].rows);
I also tried deleting the sheet and re-adding it:
spreadsheet.removeSheet(0);
spreadsheet.insertSheet(that.sheetsHeader);
Nothing really worked so far and there's no documentation for this sort of scenario. Any ideas?