I am using jsonServerRestClient in rest-on-admin to get ReferenceField. However, it show blank all the time. Am I missing anything? Below is what I did 1. add the proper source in the App.js
const App = () => (
<Admin title="Admin" restClient={simpleRestClient('http://localhost:8080/api/df')}>
<Resource name="tr" options={{ label: 'Transform' }} list={TransformList}/>
<Resource name="status" />
</Admin>
);
2. The file list the field
export const TransformList = (props) => (
<List {...props} title="Transform List" filters={<TransformFilter />}>
<Datagrid
<TextField source="name" />
<ReferenceField label="state" source="id" reference="status">
<TextField source="state" />
</ReferenceField>
</Datagrid>
</List>
);
3. I am able to see the json response from the status rest api call by using the right id in Chrome developer "network" tab as below. But it does not show in the list field. There is no any error in console as well. Other column in transform, such as name, shows correcty.
{ "taskId" : "test", "jobId" : "72e24dd84b5508f2e1de3e7c19a7a357", "state" : "RUNNING", "jobState" : "RUNNING" }
In ReferenceField, you refer to the linked table by "id" but in the data {...} of this field there is no? Probably it is required "jobId" to change on "id"?