Available in the Full Version
Spreadsheet - Overview
The igSpreadsheet control allows visualization of spreadsheet data, represented by the data model supported by the Infragistics Javascript Excel Library comprising of Workbooks, Worksheets, Cells, Formulas and more.
This sample uses CTP (Community Technical Preview) features. The API and behavior may change when these features are released with full support.
Wj
Statistics
- Table2
- Table3
Table data
Statistics
Global Oil Demand
Millions of barrels per day
Region
2013 / Q1
2013 /Q2
2013 / Q3
2013 / Q4
2014 / Q1
2014 / Q2
2014 / Q3
2014 / Q4
Africa
3.8
3.8
3.7
3.8
3.9
4
3.9
4
Americas
30.1
30.4
30.8
30.5
30.3
30.5
30.9
30.7
Asia
30.6
29.6
29.5
30.8
31
30.2
30.2
31.4
Europe
13.8
14.5
14.7
14.4
14
14.3
14.6
14.4
Former Soviet Union
4.3
4.5
4.8
4.8
4.4
4.7
4.9
4.9
Middle East
7.5
7.9
8.3
7.6
7.6
8.1
8.5
7.9
World
90.1
90.7
91.8
91.9
91.2
91.8
93.0
93.3
Average
91.7
Min
90.1
Max
93.3
This sample is designed for a larger screen size.
On mobile, try rotating your screen, view full size, or email to another device.
Code View
Copy to Clipboard
if ($("#spreadsheet1").length !== 0) { $("#spreadsheet1").igSpreadsheet({ height: "600", width: "100%", activeWorksheetChanged: function (evt, ui) { if (ui.newActiveWorksheetName == "Statistics") { $("#spreadsheet1").igSpreadsheet("option", "activeCell", "E7"); } else { $("#spreadsheet1").igSpreadsheet("option", "activeCell", "J15"); } } }); var workbook = null; var xhr = new XMLHttpRequest(); xhr.open('GET', '../../data-files/statistic.xlsx', true); xhr.responseType = 'arraybuffer'; xhr.onload = function (e) { // response is unsigned 8 bit integer var responseArray = new Uint8Array(this.response); $.ig.excel.Workbook.load(responseArray, function () { workbook = arguments[0]; setInitialSettings(); }, function () { console.log("fail"); }) }; xhr.send(); function setInitialSettings() { $("#spreadsheet1").igSpreadsheet("option", "workbook", workbook); var ws = workbook.worksheets("Table data"); $("#spreadsheet1").igSpreadsheet("option", "activeWorksheet", ws); $("#spreadsheet1").igSpreadsheet("option", "activeCell", "J15"); $("#spreadsheet1").igSpreadsheet("option", "zoomLevel", "95"); } }
<div id="spreadsheet1"></div>
.ui-igspreadsheet .ui-menu-item { white-space: nowrap; }
<!DOCTYPE html> <html> <head> <title>igSpreadsheet Overview</title> <link href="http://cdn-na.infragistics.com/igniteui/2024.2/latest/css/themes/infragistics/infragistics.theme.css" rel="stylesheet" /> <link href="http://cdn-na.infragistics.com/igniteui/2024.2/latest/css/structure/infragistics.css" rel="stylesheet" /> <script src="http://ajax.aspnetcdn.com/ajax/modernizr/modernizr-2.8.3.js"></script> <script src="http://code.jquery.com/jquery-1.11.3.min.js"></script> <script src="http://code.jquery.com/ui/1.11.1/jquery-ui.min.js"></script> <!-- Ignite UI for jQuery Required Combined JavaScript Files --> <script src="http://cdn-na.infragistics.com/igniteui/2024.2/latest/js/infragistics.core.js"></script> <script src="http://cdn-na.infragistics.com/igniteui/2024.2/latest/js/infragistics.lob.js"></script> <script src="http://cdn-na.infragistics.com/igniteui/2024.2/latest/js/infragistics.excel-bundled.js"></script> <script src="http://cdn-na.infragistics.com/igniteui/2024.2/latest/js/infragistics.spreadsheet-bundled.js"></script> <style> .ui-igspreadsheet .ui-menu-item { white-space: nowrap; } </style> </head> <body> <div id="spreadsheet1"></div> <script type="text/javascript"> $( function () { if ($("#spreadsheet1").length !== 0) { $("#spreadsheet1").igSpreadsheet({ height: "600", width: "100%", activeWorksheetChanged: function (evt, ui) { if (ui.newActiveWorksheetName == "Statistics") { $("#spreadsheet1").igSpreadsheet("option", "activeCell", "E7"); } else { $("#spreadsheet1").igSpreadsheet("option", "activeCell", "J15"); } } }); var workbook = null; var xhr = new XMLHttpRequest(); xhr.open('GET', '/data-files/statistic.xlsx', true); xhr.responseType = 'arraybuffer'; xhr.onload = function (e) { // response is unsigned 8 bit integer var responseArray = new Uint8Array(this.response); $.ig.excel.Workbook.load(responseArray, function () { workbook = arguments[0]; setInitialSettings(); }, function () { console.log("fail"); }) }; xhr.send(); function setInitialSettings() { $("#spreadsheet1").igSpreadsheet("option", "workbook", workbook); var ws = workbook.worksheets("Table data"); $("#spreadsheet1").igSpreadsheet("option", "activeWorksheet", ws); $("#spreadsheet1").igSpreadsheet("option", "activeCell", "J15"); $("#spreadsheet1").igSpreadsheet("option", "zoomLevel", "95"); } } }); </script> </body> </html>
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- Ignite UI for jQuery Required Combined CSS Files --> <link href="/igniteui/css/themes/infragistics/infragistics.theme.css" rel="stylesheet" /> <link href="/igniteui/css/structure/infragistics.css" rel="stylesheet" /> <link href="/igniteui/css/structure/modules/infragistics.ui.spreadsheet.css" rel="stylesheet" /> <!-- 1. Load libraries --> <script src="/js/modernizr.min.js"></script> <script src="/js/jquery.min.js"></script> <script src="/js/jquery-ui.min.js"></script> <!-- ReactJS library --> <script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.3.2/react.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.3.2/react-dom.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.6.16/browser.js"></script> <!-- Ignite UI for jQuery Required Combined JavaScript Files --> <script src="/igniteui/js/infragistics.core.js"></script> <script src="/igniteui/js/infragistics.lob.js"></script> <script src="/igniteui/js/infragistics.excel-bundled.js"></script> <script src="/igniteui/js/infragistics.spreadsheet-bundled.js"></script> <!-- Ignite UI for jQuery ReactJS Files --> <script src="https://unpkg.com/igniteui-react@1.2.0/igniteui-react.js"></script> <script src="https://unpkg.com/igniteui-react@1.2.0/ui/igSpreadsheet.js"></script> </head> <body> <div id="app"> <script type="text/babel"> var App= React.createClass({ render: function() { var spreadsheet = { width: "75%", height: "600" }; return ( <IgSpreadsheet id="spreadsheet" width={spreadsheet.width} height={spreadsheet.height} /> ) } }); ReactDOM.render( <App />, document.getElementById("app") ); fetch('/data-files/statistic.xlsx', { method: 'GET' }) .then((response) => response.arrayBuffer()) .then((response) => { $.ig.excel.Workbook.load(new Uint8Array(response), function () { var workbook = arguments[0]; $("#spreadsheet").igSpreadsheet("option", "workbook", workbook); }, function () { console.log("fail"); }) }) </script> </div> </body> </html>