var columns = [
{title: 'Test', 'dataKey': 'address.test'}
// ...
];
var data = [
{address: {test: 'value'}},
{address: {test: 'value 2'}},
];
I'm not sure what you mean. Could you provide more details?
@simonbengtsson I want get address.test value in data object.
Or do a map @marioidival
var exportData = data.map(function(item){
return item.address;
});
var columns = [
{title: 'Test', 'dataKey': 'test'}
// ...
];
Where do you want to get adress.test?
By the way, {title: 'Test', 'dataKey': 'address.test'} will match var data = [{'address.test': {test: 'value'}}].
@simonbengtsson will match var data = [{'address': {test: 'value'}}] ???
Nope it matches what I posted above. You would have to flatten your object before passing it to the plugin.
If you are still having problems, let me know!
I've utilized @Purush0th's suggestion to a good effect. Thats the way to go if you happen to have a situation where you have nested object property which you have to use as the dataKey.