Replies: 1 comment
-
OK! Fixed it myself. The problem was I was declaring the column object in a scope that couldn't see the props etc... So (where afn holds the values {field: "CategoryId", from: "Categories", match: "id", display: "name"} It also works with Cell,
Now, how can I get a dropdown/menu of choices when editing a row (with the display value being seen and the id being the value that is used!)??????? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
Am trying to learn mrt, but stuck on what I think is a simple need.
I have a dataset (products) that I want to display in an mrt that has (simplified)
product_name, category_id
.category_id
is an id that maps into a different dataset:categories
, that hasid
andname
.I want' the table to display the friendly name from the categories table, using
category_id = id
.I thought I could do this with an accessorFn, but I can't see a way of accessing the categories dataset (or any other prop in the component). I also tried the
Cell
prop....but same issue.Can someone kick me in the right direction please?
Silly Example:
Products: [{"TCL 55", 1}, {"Samsung AC", 2}]
Categories: [id: 1, name: "TV"}, {id:2, name: "AirCon"}]
The resultant MRT should show:
TCL 55" TV
Samsung AC AirCon
H-E-L-P!
Beta Was this translation helpful? Give feedback.
All reactions