Products

Back to the Documentation

Defined Names

Define a name for a cell or a range of cells. Apply those to your formulas to create clear expressions.

Documentation

Methods

Available methods

Method Description
getDefinedNames Get a defined name.
getDefinedNames(index: String) => Object
@Param string - defined names identification.
setDefinedNames Create a new defined name.
setDefinedNames(names: Array) => void
@param {array} - Array with the new defined names.

Settings

All available properties to define a validation

Property Description
definedNames: array An array of defined names

Example

Initiate the spreadsheet with defined names.

<html>
<script src="https://jspreadsheet.com/v9/jspreadsheet.js"></script>
<link rel="stylesheet" href="https://jspreadsheet.com/v9/jspreadsheet.css" type="text/css" />
<script src="https://jsuites.net/v5/jsuites.js"></script>
<link rel="stylesheet" href="https://jsuites.net/v5/jsuites.css" type="text/css" />

<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Material+Icons" />

<div id="spreadsheet"></div>

<script>
let set = function() {
    // Create a new defined name
    spreadsheet[0].setDefinedNames([{
        index: 'Calculations',
        value: 'Sheet1!A1:A6',
    }]);
}

// Set the extension
jspreadsheet.setExtensions({ formula });

// Set your JSS license key (The following key only works for one day)
jspreadsheet.setLicense('NjRjN2FjM2E5NDM4NDg1NGExNTIyZmVlYjc3OWM0NjI2MTNlMjA3MGJlM2EyOWJmZmZmOWI1ODJjOGVmODFmMzg0MDc2ZDY0ZWJkMGVjMGQ5ODliMDExNzg5M2I2YTdlYThjZTIzZDY3YWJhNzM2YTY2YjljODc4OTcxMjBmMjgsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpNMU1Ea3hOVE14TENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0ozWldJaUxDSnNiMk5oYkdodmMzUWlYU3dpY0d4aGJpSTZJak0wSWl3aWMyTnZjR1VpT2xzaWRqY2lMQ0oyT0NJc0luWTVJaXdpZGpFd0lpd2lkakV4SWl3aVkyaGhjblJ6SWl3aVptOXliWE1pTENKbWIzSnRkV3hoSWl3aWNHRnljMlZ5SWl3aWNtVnVaR1Z5SWl3aVkyOXRiV1Z1ZEhNaUxDSnBiWEJ2Y25SbGNpSXNJbUpoY2lJc0luWmhiR2xrWVhScGIyNXpJaXdpYzJWaGNtTm9JaXdpY0hKcGJuUWlMQ0p6YUdWbGRITWlMQ0pqYkdsbGJuUWlMQ0p6WlhKMlpYSWlMQ0p6YUdGd1pYTWlYU3dpWkdWdGJ5STZkSEoxWlgwPQ==');

// Create a new spreadsheet
let spreadsheet = jspreadsheet(document.getElementById('spreadsheet'), {
    toolbar: true,
    worksheets: [{
        data: [
            [10, "=SUM(Summary)"],
            [20, ""],
            [30, ""],
            [40, ""],
            [50, ""]
        ],
        minDimensions: [6, 6],
    }],
    definedNames: {
        Summary: 'Sheet1!A1:A6',
    }
});
</script>
</html>