7 Answers, 1 is accepted
var
spreadsheet = $(
"#spreadsheet"
);
var
activeSheet = spreadsheet.activeSheet();
activeSheet.options.showGridLines =
false
;
client side
Thanks, Jared, you're absolutely right.
I see that this option is missing in the Spreadsheet API. Will add it right away.
Regards,
T. Tsonev
Telerik
Perhaps I spoke a bit too soon. The option is currently accessible only when loading the spreadsheet from configuration or from external source (JSON, XLSX).
For example:
<script>
$("#spreadsheet").kendoSpreadsheet({
sheets: [{
name: "Food Order",
showGridLines: false,
mergedCells: [
"A1:G1"
],
rows: [{
height: 70,
cells: [{
value: "My Company", fontSize: 32, textAlign: "center"
}]
}]
}]
});
</script>
Changing it at run-time is not supported. For the next release, the Sheet will have a showGridLines method:
var spreadsheet = $("#spreadsheet").data("kendoSpreadsheet");
var activeSheet = spreadsheet.activeSheet();
activeSheet.showGridLines(false);
Note that the sheet.options.showGridLines field will be removed. It was not intended to be a part of the public API.
Regards,
T. Tsonev
Telerik
Sorry, my bad. The provided samples only work against the latest builds for our next release.
For the current version, the code is a bit more involved. I've created a sample in the dojo.
if (activeSheet.showGridLines) {
// Kendo UI 2016.2 and beyond
activeSheet.showGridLines(false);
} else if (activeSheet.options) {
// Kendo UI 2016.1
activeSheet.batch(function() {
activeSheet.options.showGridLines = false;
}, { layout: true });
}
Apologies for the caused inconvenience.
Regards,
T. Tsonev
Telerik
Tsonev,
I am using the Kendo version 2016.1.112 . I tried to call the showGridLines property and I got this error . Please advice.
TypeError: Cannot read property 'start' of undefined
at e.support.browser.msie.e.support.browser.version.e.Class.extend.visible
Uncaught TypeError: Cannot read property 'start' of undefinede.support.browser.msie.e.support.browser.version.e.Class.extend.visible
Code snippet :
var sheet = spreadsheet.sheetByIndex(0);
sheet.fromJSON({
name : gridData.name,
frozenRows : gridData.frozenRows,
frozenColumns : gridData.frozenColumns,
rows : gridData.rows,
columns : gridData.columns
});// sheet json
if( sheet.options )
{
console.log("in sheet options ");
sheet.batch(function() {
sheet.options.showGridLines = false;
}, { layout: true });
}
Thanks,
Hema
Please accept my apologies for the delayed response.
I tried to reproduce the issue in the standalone example, but without luck.
Can you try upgrading to the latest version?
The error is strange to begin with. Please check if you're not loading the Kendo UI scripts twice.
Regards,
T. Tsonev
Telerik