Freeze Panes helps you to keep particular rows or columns visible when scrolling the sheet content in the spreadsheet. You can specify the number of frozen rows and columns using the frozenRows
and frozenColumns
properties inside the Sheet
property.
User Interface:
In the active spreadsheet, click the cell where you want to create freeze panes. Freeze panes can be done in any of the following ways:
Freeze Panes
item.freezePanes
method programmatically.It allows you to keep a certain number of rows visible while scrolling vertically through the rest of the worksheet.
User Interface:
In the active spreadsheet, select the cell where you want to create frozen rows. Frozen rows can be done in any one of the following ways:
Freeze Rows
item.frozenRows
property inside the Sheet
property.It allows you to keep a certain number of columns visible while scrolling horizontally through the rest of the worksheet.
User Interface:
In the active spreadsheet, select the cell where you want to create frozen columns. Frozen columns can be done in any one of the following ways:
Freeze Columns
item.frozenColumns
property inside the Sheet
property.In this demo, the frozenColumns is set as ‘2’, and the frozenRows is set as ‘2’. Hence, the two columns on the left and the top two rows are frozen.
ej.base.enableRipple(true);
var spreadsheet = new ej.spreadsheet.Spreadsheet({
sheets: [{ ranges: [{ dataSource: tradeData,
columns: [{ width: 180 }, { width: 180 },{ width: 180},
{ width: 180 }, { width: 180 },{ width: 180},
{ width: 180 }, { width: 180 },{ width: 180}, { width: 180 }, { width: 180 },{ width: 180}] }],
// Specifies the number of frozen rows
frozenRows: 2,
// Specifies the number of frozen columns
frozenColumns: 2
}],
});
spreadsheet.appendTo('#spreadsheet');
<!DOCTYPE html><html lang="en"><head>
<title>EJ2 SpreadSheet</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Typescript UI Controls">
<meta name="author" content="Syncfusion">
<link rel="shortcut icon" href="resources/favicon.ico">
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.1.35/ej2-base/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.1.35/ej2-inputs/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.1.35/ej2-buttons/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.1.35/ej2-splitbuttons/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.1.35/ej2-lists/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.1.35/ej2-navigations/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.1.35/ej2-popups/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.1.35/ej2-dropdowns/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.1.35/ej2-grids/styles/material.css" rel="stylesheet">
<link href="//cdn.syncfusion.com/ej2/21.1.35/ej2-spreadsheet/styles/material.css" rel="stylesheet">
<link href="styles.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/core-js/2.4.1/shim.min.js"></script>
<script src="system.config.js"></script>
<script src="https://cdn.syncfusion.com/ej2/21.1.35/dist/ej2.min.js" type="text/javascript"></script>
<script src="es5-datasource.js" type="text/javascript"></script>
</head>
<body>
<!--Element which is going to render-->
<div id="container">
<div id="spreadsheet"></div>
</div>
<script>
var ele = document.getElementById('container');
if(ele) {
ele.style.visibility = "visible";
}
</script>
<script src="index.js" type="text/javascript"></script>
</body></html>
Here, we have listed out the limitations with Freeze Panes feature.