Loading from JSON

Loading from json and keep the references



Source code

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

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

<script>
var data = [
    {
        name:'Paul Hodel',
        id:'3',
        age:'40',
        gender:'Male'
    },
    {
        name:'Rogerio Sergio',
        id:'4',
        age:'48',
        gender:'Male'
    },
    {
        name:'Jorgina Santos',
        id:'5',
        age:'32',
        gender:'Female'
    },
    {
        name:'Arnaldo Antunes',
        id:'6',
        age:'63',
        gender:'Male'
    },
];

jexcel(document.getElementById('spreadsheet'), {
    json: data,
    columns: [
        {
            type:'text',
            width:'300',
            name:'id'
        },
        {
            type:'text',
            width:'200',
            name:'name'
        },
        {
            type:'text',
            width:'100',
            name:'age'
        },
        {
            type:'hidden',
            name:'gender'
        },
     ],
     license: '39130-64ebc-bd98e-26bc4',
});
</script>

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

<input type='button' onclick="document.getElementById('log').value =
    JSON.stringify(document.getElementById('spreadsheet').jexcel.getJson())"
    value='Get JSON'>
    
</html>