Join Data Sources

<DataSource ID=“manufacturerDMI” serverType=“generic”>
<fields>
<field name=“id” type=“text” length=“50”/>
<field name=“name” type=“text” length=“50”/>
</fields>
<serverObject lookupStyle=“spring” bean=“manufacturerDmiProxy”/>
</DataSource>

<DataSource ID=“materialDMI” serverType=“generic”>
<fields>
<field name=“manufacturer” type=“manufacturerDMI”/>
<field name=“supplierCode” type=“text” length=“50”/>
<field name=“unit” type=“text” length=“50”/>
<field name=“name” type=“text” length=“50”/>
</fields>
<serverObject lookupStyle=“spring” bean=“materialDmiProxy”/>
</DataSource>

I get the materialDMI from the server and i’d like list it in a listGrid. But now, the manufacturer field is an Object. If i use the code below, then at the column ‘manufacturer’ i will see that (object Object).
How could i define a field which give back to me the field ‘name’ from the manufacturerDMI?

<isomorphic:loadDS ID=“manufacturerDMI”/>
<isomorphic:loadDS ID=“materialDMI”/>

ListGrid.create({
ID:“test”,
autoDraw: true,
dataSource: materialDMI,
fields:[
{name:“manufacturer”, title:“Manufacturer”},
{name:“supplierCode”, title:“Supplier Code”},
{name:“unit”, title:“Unite”},
{name:“name”, title:“Name”}
]
})

test.filterData();

Did you actually mean to load the subobjects? If you only need the name, you can use field.valueXPath to extract it on the server side. You can do this for whatever fields you want and they will be saved back to the subobject automatically.

If you intend, for whatever reason, to deliver the subobjects to the browser, you can use a formatCellValue function to return just the name. The “value” you are passed will be a JavaScript object, so value.name would be the name.