The headers of rows and columns of a sheet can be hidden with the help of the hideHeaders method.
You should pass the necessary state of headers as a parameter:
// hide headers
$$("ssheet").hideHeaders(true);
// show headers
$$("ssheet").hideHeaders(false);
Related sample: Borders and Gridlines
You can also hide the lines of the SpreadSheet grid.
Use the hideGridlines() method for this purpose. The method takes the boolean parameter state:
// hide grid lines
$$("ssheet").hideBorders(true);
// show grid lines
$$("ssheet").hideBorders(false);
Related sample: Borders and Gridlines
You can add several sheets into a SpreadSheet. Follow these steps:
1) enable a bottom bar
A bottom bar is necessary to switch between the sheets. For this, use the bottombar property with the true value.
2) add the desired number of sheets with their configuration
The sheets config is the solution you need. As its value you need to specify an array of sheet objects. Each object has the following properties:
webix.ui({
view:"spreadsheet",
data:{
sheets: [
{
name: "Tab 1",
content:{
data:[
[1,1,"Page 1"]
]
}
},
{
name: "Tab 2",
content:{
data:[
[1,1,"Page 2"]
]
}
},
{
name: "Tab 3",
content:{
data:[
[1,1,"Page 3"]
]
}
}
]
},
bottombar:true
});
Related sample: Multiple sheets
Alternatively, you can load sheets as an array of objects with sheet names and content:
webix.ui({
view:"spreadsheet",
data: [
{
name: "Tab 1",
content:{ .. }
},
{
name: "Tab 2",
content:{ .. }
},
{
name: "Tab 3",
content:{ .. }
}
],
bottombar:true
});
You can add a new sheet by using the addSheet method. You should pass the sheet's content as a parameter:
$$("ssheet").addSheet(content);
It is possible to copy the content of a sheet into a new sheet. You need to complete two steps:
1) get content of the sheet you want to copy with the help of the serialize() method:
// getting content of the active sheet
var content = $$("ssheet").serialize();
2) create a new sheet using the addSheet method and pass the received content as a parameter:
// copy to a new sheet
$$("ssheet").addSheet(content);
You can easily access the data of any sheet cell as well as get the necessary range of cells or a named range via the SpreadSheet API. Your steps are:
// getting a cell value
$$("ssheet").getSheetData(sheet_name).getValue(1,1) => "Report"
// getting a range of cells
$$("ssheet").getSheetData(sheet_name).getRangeValue("C6:D7") => [140,50,48,200]
// getting a named range
$$("ssheet").getSheetData(sheet_name).getRangeValue("AFTERDATA") => [140,50,48,200]
Back to top