Meta information

Jspreadsheet meta information is a feature to help keep hidden information about cells not visible for the users.

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





Source code

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

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

<script>
var 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'],
];

var table = jspreadsheet(document.getElementById('spreadsheet'), {
    data:data,
    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' }
    },
    license: 'NzcyZDQ0MTNhZjgyZjcyOTYwYTBlNmU5NTU5MmNhN2EzYWRlYjdlMTI2YzU1MDdiNjI1NTA1MDg0OWNmNjE5ZTQ1NzIxZjI1MWMzNWJiZWQyZTVkNzgwMTI4NGI3NjUwNDcxZWM2MjI1ZjdmNWFjMDIyYThkNDRhOTBjYzBlYzcsZXlKdVlXMWxJam9pU25Od2NtVmhaSE5vWldWMElpd2laR0YwWlNJNk1UY3hNVFkzTnpJMU9Dd2laRzl0WVdsdUlqcGJJbXB6Y0hKbFlXUnphR1ZsZEM1amIyMGlMQ0pqYjJSbGMyRnVaR0p2ZUM1cGJ5SXNJbXB6YUdWc2JDNXVaWFFpTENKamMySXVZWEJ3SWl3aWQyVmlJaXdpYkc5allXeG9iM04wSWwwc0luQnNZVzRpT2lJek5DSXNJbk5qYjNCbElqcGJJblkzSWl3aWRqZ2lMQ0oyT1NJc0luWXhNQ0lzSW1Ob1lYSjBjeUlzSW1admNtMXpJaXdpWm05eWJYVnNZU0lzSW5CaGNuTmxjaUlzSW5KbGJtUmxjaUlzSW1OdmJXMWxiblJ6SWl3aWFXMXdiM0owWlhJaUxDSmlZWElpTENKMllXeHBaR0YwYVc5dWN5SXNJbk5sWVhKamFDSXNJbkJ5YVc1MElpd2ljMmhsWlhSeklsMHNJbVJsYlc4aU9uUnlkV1Y5',
    allowComments: true,
});
</script>

<button type="button" onclick="table.setMeta({ C1: { id:'1', y:'2019' }, C2: { id:'2' } });">Set meta data for multiple columns</button>
<button type="button" onclick="table.setMeta('B2', 'myMetaData', prompt('myMetaData:'));">Set a meta information for B2</button>
<button type="button" onclick="document.getElementById('console').value = JSON.stringify(table.getMeta('A1'));">Get the meta information for A1</button>
<button type="button" onclick="document.getElementById('console').value  = JSON.stringify(table.getMeta());">Get all meta information</button>

</html>