load( local!empStatus: { { name: "Ajay", status: "test1" }, { name: "Ajay", status: "test2" }, { name: "kumar", status: "test3" }, { name: "phani", status: "test4" } }, local!empDetail: { { name: "Ajay" }, { name: "kumar" }, { name: "phani" } }, a!boxLayout( label: "Form", contents: { a!gridField( label: "grid", data: local!empDetail, pageSize: 5, pagingSaveInto: fv!pagingInfo, columns: { a!gridColumn(label: "Name", value: fv!row.name), a!gridColumn( label: "Status", value: a!forEach( items: local!empStatus, expression: fv!item.status ) ) } ) } ) )
Hi All,
I have added the sample code and the output where I need to display the corresponding status for that particular name.
for example: Name: Ajay Status should be Test1, Test2 and similarly
for Name: Kumar Status should be Test3
and for Name: Phani status should be Test4.
Thanks in advance,
Gousii.
Discussion posts and replies are publicly visible
load( local!empStatus: { { name: "Ajay", status: "test1" }, { name: "Ajay", status: "test2" }, { name: "kumar", status: "test3" }, { name: "phani", status: "test4" } }, local!empDetail: { { name: "Ajay" }, { name: "kumar" }, { name: "phani" } }, a!boxLayout( label: "Form", contents: { a!gridField( label: "grid", data: local!empDetail, pageSize: 5, pagingSaveInto: fv!pagingInfo, columns: { a!gridColumn(label: "Name", value: fv!row.name), a!gridColumn( label: "Status", value: joinarray( index( local!empStatus.status, wherecontains( fv!row.name, touniformstring(local!empStatus.name) ), {} ), "," ) ) } ) } ) )
Thank You!!!
load( local!empStatus: { { name: "Ajay", status: "test1" }, { name: "Ajay", status: "test2" }, { name: "kumar", status: "test3" }, { name: "phani", status: "test4" } }, local!empDetail: { { name: "Ajay" }, { name: "kumar" }, { name: "phani" } }, a!boxLayout( label: "Form", contents: { a!gridField( label: "grid", data: local!empDetail, pageSize: 5, pagingSaveInto: fv!pagingInfo, columns: { a!gridColumn(label: "Name", value: fv!row.name), a!gridColumn( label: "Status", value: a!forEach( items: local!empStatus, expression: if(fv!row.name=fv!item.name,fv!item.status,{}) ) ) } ) } ) )
It is more readable in a code box
okay thanks, next time I will.
You can edit that as well
Why are you still using load instead of localVariables?
Also, a couple of observations
a!forEach( items: local!empStatus, expression: fv!item.status )
Here, forEach is not being used. It is useless. Rather you can just write local!empStatus.status.
pagingSaveInto: fv!pagingInfo,
fv!pagingInfo gives you the current pagingInfo. You should use a variable instead that you are passing in your query as pagingInfo
Thank You!!
Sure Thank You!!