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
When a nested object is returned from the API, it would be nice if the configured columns key property could be set to get that value that is nested. So if my api returned an object like this:
This can be achieved with the get function from lodash --> https://lodash.com/docs/4.17.15#get
So maybe instead of doing this {{ row[column.key] }}, we could try this {{ row[get(rows, column.key, row[column.key])] }}
The text was updated successfully, but these errors were encountered:
I can only express my personal opinion as a user of this library, and perhaps the authors will have a different view, but considering this is meant to be a lean UI kit, I'd think introduction of third party scripts should be kept to minimum.
What you've described can be easily achieved as you've demonstrated in the example provided, and I don't think that this use case warrants to have this functionality available out of the box.
In fact, the user has full control over the structure of the object passed to the component as props, and as such the label can be easily derived from a computed property.
Hey @goodpixels ,
I understand your point. The thing is, lodash is already being used in the table component lol
I agree with you on not adding too many external libraries, which is why I didn't even bother mention a validation library for the input elements
It is indeed the philosophy of the module not to rely on external libraries but I don't mind using lodash. Those functions are really small and already used in some components.
When a nested object is returned from the API, it would be nice if the configured columns key property could be set to get that value that is nested. So if my api returned an object like this:
We should be able to pass the key like this to the
columns
prop:This can be achieved with the
get
function from lodash --> https://lodash.com/docs/4.17.15#getSo maybe instead of doing this
{{ row[column.key] }}
, we could try this{{ row[get(rows, column.key, row[column.key])] }}
The text was updated successfully, but these errors were encountered: