If I have a JSON response like,
{
"something": "foo",
"subobject": {
"id": "bar",
"name": "baz"
}
}
I am loading the response into a form using form.setValues(responseObject).
If I have displayfield in the form that is subobject, how do I put that name from the subobject into that field? Or better yet, how do I put the name and the id into that field?
I tried a custom renderer, but the value parameter passed into the renderer is a string containing "[object Object]".
I am using ExtJS 4.1.3. Anyone have any advice?
Got it to work by adding the following to my displayfield config
The standard valueToRaw converts the object to a string, which is of no use to anyone.
I then added this custom renderer to display my field as a link,
I feel like I should be able to use a template instead of a custom renderer, but I had no luck getting that working.