insertSheet

Inserts a sheet with the specified options.

Example - inseart new sheets on button click

<div id="spreadsheet"></div>
<button>Add New Sheet</button>
<script>
  var i = 2
  $("#spreadsheet").kendoSpreadsheet({
    sheets: [{ name: "Sheet1" }, { name: "Sheet2" }]
  });
  var sheets = $("#spreadsheet").data("kendoSpreadsheet").sheets();
  $("button").click(function(){
    $("#spreadsheet").data("kendoSpreadsheet").insertSheet({
      name: "Custom Sheet Name" + ++i,
      frozenRows: 1,
      frozenColumns: 1,
      rows: 15,
      columns: 10,
    });
  })
</script>

Parameters

options Object

The configuration options for the sheet.

options.rows Number

The number of rows in this sheet.

options.columns Number

The number of columns in this sheet.

options.rowHeight Number

The row height in this sheet in pixels.

options.columnWidth Number

The column width in this sheet in pixels.

options.headerHeight Number

The header row height in pixels.

options.headerWidth Number

The header column width in pixels.

options.dataSource kendo.data.DataSource

The data source for this sheet.

options.data Object

The sheet state and data as Object. The schema follows the same structure as the widget configuration.

Returns

kendo.spreadsheet.Sheet - The inserted sheet.

In this article