Right now I have and Active Sheet and inactive sheet. Onclick I load data for the the Active sheet. I understand how to create another sheet tab name. Is there any documentation on Loading data to the second sheet or syntax.
Active Sheet >>>> var spreadsheet = $("#spreadsheet").data("kendoSpreadsheet");
var sheet = spreadsheet.activeSheet();
sheet.range("D6:I6").values(column);
InActive Sheet >>>> var spreadsheet 2= $("#spreadsheet").data("kendoSpreadsheet");
var sheet2 = spreadsheet.InactiveSheet();
sheet2.range("D6:I6").values(newcolumn);
5 Answers, 1 is accepted
Hello Frank,
The sheets method returns a list of all sheets. The inactive ones are the ones that are different than the active sheet.
Regards,Alex Gyoshev
Telerik by Progress
Hello Frank,
You can loop through the sheets and call the setDataSource method to bind them to a data source. There is no inactiveSheet method, because there may be more than one inactive sheets.
Regards,Alex Gyoshev
Telerik by Progress
How to add column name from the current data source into newly inserted sheet. tried with insertSheet and setDataSource method but it creates extra one more sheet. . also
var spreadsheet = $("#spreadsheet");
var sheets = $("#spreadsheet").data("kendoSpreadsheet").sheets()
lengthsheets=sheets.length
var temp= $("#spreadsheet").data("kendoSpreadsheet").activeSheet(sheets[sheets.length-1]);
temp.setDataSource([], [ "ProductName", "UnitPrice" ]);
gives errror as undefined setDataSource. Please help
Hello, Ajinkya,
I am not sure I completely understand the question. Could you please provide some additional information so that I can better understand the requirement?
As for the error, after setting the active sheet, you need to use the activeSheet method again to get the active sheet:
$("#spreadsheet").kendoSpreadsheet();
var spreadsheet = $("#spreadsheet");
var sheets = $("#spreadsheet").data("kendoSpreadsheet").sheets()
var lengthsheets=sheets.length;
$("#spreadsheet").data("kendoSpreadsheet").activeSheet(sheets[sheets.length-1]);
var temp= $("#spreadsheet").data("kendoSpreadsheet").activeSheet()
temp.setDataSource(dataSource, [ "ProductName", "UnitPrice" ]);
Here is a small example for reference.
Regards,
Martin
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.