SpreadJS Documentation
Using Previous Code with the Current Version
SpreadJS Documentation > Developer's Guide > Getting Started > Using Previous Code with the Current Version

You can continue to use version 9 code with SpreadJS version 12.

Add the gc.spread.sheets.migration.12.0.0.js reference to your page for backward compatibility. The gc.spread.sheets.all.12.0.0.js file is also required.

Several methods are not supported for backward compatibility: buildFont, Compose, and Clear (Style class).

Using Code

This example references the migration file.

JavaScript
Copy Code
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>SpreadJS</title>
    <link href="./css/gc.spread.sheets.excel2013white.12.0.0.css" rel="stylesheet"/>
    <script src="./scripts/gc.spread.sheets.all.12.0.0.js" type="application/javascript"></script>
    <script src="./scripts/interop/gc.spread.sheets.migration.12.0.0.js" type="application/javascript"></script>
    <script type="text/javascript">
        window.onload = function(){
            //This is the V10 code
            var spread = new GcSpread.Sheets.Spread(document.getElementById("ss"), { sheetCount: 3 });
            var sheet = spread.getActiveSheet();
            sheet.getColumn(0).formatter('#,##0.0##');
            sheet.setValue(0, 0, 123456);
            sheet.setValue(1, 0, 12345);
        }
    </script>
</head>
<body>
    <div id="ss" style="width:100%;height:500px;border: 1px solid gray;"></div>
</body>
</html>
See Also