We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The outer object has properties name, id, age, and company. The company property is another object with properties name and location.
var table = jexcel(document.getElementById('spreadsheet'), { data:[ { name:'Jorge', id:'3', age:'40',company:{name:'nokia',location:'us'} }, { name:'Robert', id:'4', age:'48',company:{name:'nokia',location:'us'} }, { name:'Santos', id:'5', age:'32',company:{name:'nokia',location:'us'} }, ], columns: [ { type:'text', width:300, name:'id', title:'id' }, { type:'text', width:100, name:'name', title:'name' }, { type:'text', width:100, name:'age', title:'age' }, { type:'text', width:100, data:'company.name', title:'company name' }, { type:'text', width:100, data:'company.location', title:'company location' }, ] });
and the result table looks like this:
An example of this issue here: https://jsfiddle.net/sridharnetha/vf0tknxb/2/
The text was updated successfully, but these errors were encountered:
customizing the script by using a method updateTable should work.
updateTable
data = [ { name:'Jorge', id:'3', age:'40',company:{name:'nokia',location:'us'} }, { name:'Robert', id:'4', age:'48',company:{name:'nokia',location:'us'} }, { name:'Santos', id:'5', age:'32',company:{name:'nokia',location:'us'} }, ]; jspreadsheet(document.getElementById('my-spreadsheet'), { data:data, allowInsertColumn: false, columns: [ { type:'text', width:50, name:'id', title:'id' }, { type:'text', width:100, name:'name', title:'name' }, { type:'text', width:50, name:'age', title:'age' }, { type:'object', width:100, data:'company.name', title:'company name' }, { type:'text', width:100, data:'company.location', title:'company location' }, ], updateTable:function(instance, cell, col, row, val, label, cellName) { if (col == 3) { //alert(JSON.stringify(val)); cell.innerHTML = val.name; } } });
Sorry, something went wrong.
You can use that, on the Pro version there is a feature call data binding. https://jspreadsheet.com/docs/data
No branches or pull requests
The outer object has properties name, id, age, and company. The company property is another object with properties name and location.
and the result table looks like this:
![image](https://private-user-images.githubusercontent.com/33679589/329137009-feab6f58-9948-4d44-b192-47bf3f967057.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE5MzQ3NzEsIm5iZiI6MTcyMTkzNDQ3MSwicGF0aCI6Ii8zMzY3OTU4OS8zMjkxMzcwMDktZmVhYjZmNTgtOTk0OC00ZDQ0LWIxOTItNDdiZjNmOTY3MDU3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzI1VDE5MDc1MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTFhM2YzOGQzMjNlYTY3MDZkZjljN2RlNThmNjM0MDFkMWU3ZjQ3MDQ2ZThhOGRmOTBhMGRhNzk1MWU0NjVjYTUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.IzUec4v2SmSz6Xegg2BKHDbFq7VZB20JOlNEKZeFfic)
An example of this issue here:
https://jsfiddle.net/sridharnetha/vf0tknxb/2/
The text was updated successfully, but these errors were encountered: