You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there any workaround not specified in the doc ?
Reacted by Josh Flayhart, Samuel Martineau, Keval Bhatt, Mathieu Santostefano, Georgy Angelov, Jiawen Geng, Eirini Pappa, Alan Thomas, Christoph, elzup and 13 more
Hi @kopax, the nested object does not supported on newest version in this component, sorry for that. But I can add it in the future, but this is not in my plan, so I need more plan or thinking on this feature. :)
I have made a little modification in TableBody.js
I don't know if this is enough for the rest of the feature provided by your lib, could you check a quick look ?
Hi @kopax , it's a way to implement this feature and I think it will be OK. but there are a lots of feature in this component, include cell edit, filter ..etc. so I need to consider these part for design this feature, so it will take some time. Anyway, if you just want to "display" the nested data on component, I think your solution is ok :)
Hi @AllenFang , I am really trying hard to implement subobject management but the problem is that some comments are missing in your code.
Could you provide me further runtime details ?
My idea would be to add a dataPath="Person" to TableHeaderColumn props
I have two table Person and User
User doesn't have a primaryKey, the indexKey in User is person_id
The current add/edit feature add new User instance to dataSet with wrong nested Object (created key is "Person.firstname", insteand of "Person": { "firstname": ... }
I think I can't use this feature so I will need to do a bunch of modification just for my needs
Hi @kopax, you mean you want the add/edit feature work with nested object? If yes, I thinks it's a very very hard work. And you really cant solve the problem on your side, I can help you, but you need give me your folk first
This feature is definitely welcomed. the fact that it does not support nested objects make it feel rather rigid in design. I hope to see this implemented soon =)
@AllenFang sorry for not replying. I really liked your table unfortunately I wasn't able to implement anything in your code.
I would also love to reuse react-bootstrap-table in the futur so +1 for adding the feature
that's ok, I know this feature is very important, but I'm busy and there are lot of things to do, so I prefer to fix bug first. If I've free time, I'll come back and support this features. Anyway, PR is welcome :)
Thanks
sorry guys, as I mention on README, I already decide to create react-bootstrap-table2, I trust it will be better than react-bootstrap-table. A good news is I'll support the nested data in react-bootstrap-table2 start from v0.0.1, bad news is I will not support the nested data in react-bootstrap-table.
Feel free to let me know your idea and any idea/issues is welcome on react-bootstrap-table2
Sorry for inconvenience.
Reacted by Dan Bovey, yuri-sakharov, Dimitri KOPRIWA and Avindra Goolcharan
Reacted by Che Hoai-Duy, Islam, Saad, Barry Michael Doyle, Luke Brown and Gary Rosenberry
Activity
AllenFang commentedon Sep 12, 2015
Hi @kopax, the nested object does not supported on newest version in this component, sorry for that. But I can add it in the future, but this is not in my plan, so I need more plan or thinking on this feature. :)
kopax commentedon Sep 12, 2015
I have made a little modification in TableBody.js
I don't know if this is enough for the rest of the feature provided by your lib, could you check a quick look ?
/blob/master/lib/TableBody.js line 101 replaced by :
What do you think ?
I think you should also handle errors.
Edit: I have just tried with filter field, doesn't work (input placeholder is "Person.firstname")
AllenFang commentedon Sep 13, 2015
Hi @kopax , it's a way to implement this feature and I think it will be OK. but there are a lots of feature in this component, include cell edit, filter ..etc. so I need to consider these part for design this feature, so it will take some time. Anyway, if you just want to "display" the nested data on component, I think your solution is ok :)
kopax commentedon Sep 15, 2015
Hi @AllenFang , I am really trying hard to implement subobject management but the problem is that some comments are missing in your code.
Could you provide me further runtime details ?
My idea would be to add a
dataPath="Person"to TableHeaderColumn propsAllenFang commentedon Sep 15, 2015
Hi @kopax , did you folk my project? I cant find your repository. I thinks I can spend a little time to watch out your folk and help you debug :)
kopax commentedon Sep 15, 2015
I didn't for some (stupid) reasons :
I have two table Person and User
User doesn't have a primaryKey, the indexKey in User is
person_idThe current add/edit feature add new User instance to dataSet with wrong nested Object (created key is
"Person.firstname", insteand of"Person": { "firstname": ... }I think I can't use this feature so I will need to do a bunch of modification just for my needs
AllenFang commentedon Sep 15, 2015
Hi @kopax, you mean you want the add/edit feature work with nested object? If yes, I thinks it's a very very hard work. And you really cant solve the problem on your side, I can help you, but you need give me your folk first
lebeier commentedon Jan 28, 2016
This feature is definitely welcomed. the fact that it does not support nested objects make it feel rather rigid in design. I hope to see this implemented soon =)
kopax commentedon Jan 28, 2016
@AllenFang sorry for not replying. I really liked your table unfortunately I wasn't able to implement anything in your code.
I would also love to reuse react-bootstrap-table in the futur so +1 for adding the feature
AllenFang commentedon Jan 28, 2016
that's ok, I know this feature is very important, but I'm busy and there are lot of things to do, so I prefer to fix bug first. If I've free time, I'll come back and support this features. Anyway, PR is welcome :)
Thanks
juancarlosfarah commentedon Jan 29, 2016
+1
Will try and have a look at this too!
ronsc commentedon Feb 2, 2016
+1
VenkataKotra commentedon Feb 9, 2016
+1
awlh commentedon Jun 21, 2016
+1
24 remaining items
kopax commentedon Jun 22, 2017
@logolevel does all the features works ?
logolevel commentedon Jun 23, 2017
kopax, yes.
romainPellerin commentedon Jun 27, 2017
@logolevel thanks so much for this example.
I am trying to aggregate data within one column like animal.firstname + animal.lastname into a path (yes I named my cat with a full name ;)).
Does any one have a solution for that?
StohlmanMatteo commentedon Jul 12, 2017
building on @PraxentSupport's response. I'm using:
function objectFormat(data, cell) { if(data.constructor===Array){ if(data[0]=='last'){ return <p>${cell[data.length-1][data[1]]}</p> } return <p>${cell[data[0]][data[1]]}</p> } return <p>${cell[data]}</p>; }dataFormat={ objectFormat.bind(this, [0,'address'])}or
dataFormat={ objectFormat.bind(this, 'number')}Note: need to ad ` around return values.
janpauldahlke commentedon Aug 1, 2017
@StohlmanMatteo
works fine for me, thanks. just a quick note for all the other coming from google. just hsow how to use `` :-)
georgewritescode commentedon Aug 19, 2017
Building off the above: (This is using lodash but can work out how to use if dont want to use lodash/underscore)
First create a method in your react component like this replacing 'datapropertywithnested.nestedpropertyname' this your specifics:
Then in your table:
<TableHeaderColumn dataField='anything' dataFormat={this.depthFormatter}> Custom </TableHeaderColumn>georgewritescode commentedon Aug 19, 2017
However the above solution doesn't support filtering
As such I found the easiest solution is to modily your data before it enters the table to flatten it, such as through:
Table as regular:
AllenFang commentedon Aug 20, 2017
sorry guys, as I mention on README, I already decide to create
react-bootstrap-table2, I trust it will be better thanreact-bootstrap-table. A good news is I'll support the nested data inreact-bootstrap-table2start fromv0.0.1, bad news is I will not support the nested data inreact-bootstrap-table.Feel free to let me know your idea and any idea/issues is welcome on
react-bootstrap-table2Sorry for inconvenience.
maxpdx commentedon Dec 12, 2017
Any updates?
Ogglas commentedon Dec 25, 2017
To people finding this thread: Using lodash works well with displaying data but the data presented will not be searchable or sortable.
AdnanBoota commentedon Mar 15, 2019
@Ogglas any idea about sorting the field? or any approach to dataSort and also dataFormat with formatExtraData?
Thanks.
AdnanBoota commentedon Mar 29, 2019
To go furthher into nested fields, i'm passing string and then returning the key/value pair.
mcmwhfy commentedon Apr 10, 2019
Or the simplest way:
<TableHeaderColumn dataSort={ true } dataFormat={this.tableDataFormat}>Name </TableHeaderColumn>you need also
dataFieldonly if you are usingisKey={ true }on element