react-data-grid
react-data-grid copied to clipboard
Select child object as key on columns
Hello I've the follow object
[ { id: 1, email: [email protected], profile: { first_name: test } } ]
how will I be able to get the first_name on profile and assign it to keys? Thank you so much
You would need a custom formatter for that, if I think that is what you mean
var ProfileFormatter = React.createClass({
render:function(){
var profile = this.props.value;
return (
<div>{profile.firstName}
</div>);
}
});
The you assign the formatter to the profile column in the column specifcations column.formatter = ProfileFormatter
@malonecj or anyone, using the above solution to nested object properties, is there a way to sort my columns using the column's formatter key? Mentioned at #889