Meta information

This feature keeps hidden information about the cells. There is no interface to define any meta information. This should be done programmatically.

Documentation

Methods

Methods related to managing the spreadsheet meta information.
MethodDescription
getMeta Get the meta information from a cell or from the whole spreadsheet.
getMeta(cellName: String | null)
@Param mixed - cell identification or null for the whole table.
setMeta Set the meta information for a single cell by name or for multiple cells.
setMeta(cellName: Mixed | Array, key: String, value: String)
@param {string|Object} - Identification of a cell or an array of objects with multiple cell meta information.
@param {string=} k - the key string to identify the meta information.
@param {string=} v - the value string with the meta information.


Events

EventDescription
onchangemetaonchangemeta(worksheet: Object, newValue: Object) : void


Initial Settings

The meta property defines the meta information for the worksheet cells.
PropertyDescription
meta: ObjectInitial meta information.


Examples

Basic example using the native meta information methods.




It is possible to interact with any meta information during initialization or programmatically using the methods: getMeta or setMeta.





Spreadsheet meta information working example on JSFiddle.

Source code

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

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

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

<textarea id='console' style='width:100%;height:80px;'></textarea>

<button type="button" onclick="table[0].setMeta({ C1: { id:'1', y:'2019' }, C2: { id:'2' } });">
Set meta data for multiple columns
</button>

<button type="button" onclick="table[0].setMeta('B2', 'myMetaData', prompt('myMetaData:'));">
Set a meta information for B2
</button>

<button type="button" onclick="document.getElementById('console').value = JSON.stringify(table[0].getMeta('A1'));">
Get the meta information for A1
</button>

<button type="button" onclick="document.getElementById('console').value  = JSON.stringify(table[0].getMeta());">
Get all meta information
</button>

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

// Create the spreadsheet
var table = jspreadsheet(document.getElementById('spreadsheet'), {
    worksheets: [{
        data: [
            ['US', 'Apples', 'Yes', '2019-02-12'],
            ['CA;US;UK', 'Carrots', 'Yes', '2019-03-01'],
            ['CA;BR', 'Oranges', 'No', '2018-11-10'],
            ['BR', 'Coconuts', 'Yes', '2019-01-12'],
        ],
        columns: [
            { type: 'dropdown', title: 'Product Origin', width: '300px', url: '/jspreadsheet/countries', autocomplete: true, multiple: true },
            { type: 'text', title: 'Description', width: '200px' },
            { type: 'dropdown', title: 'Stock', width: '100px', source: ['No','Yes'] },
            { type: 'calendar', title: 'Best before', width: '100px' },
        ],
        meta:{
            A1: { myMeta: 'this is just a test', otherMetaInformation: 'other test' },
            A2: { info: 'test' }
        },
    }]
});
</script>
</html>



Create applications with spreadsheet-like controls