I am using two local variables and the data is coming via expression rules (there are multiple columns)
local!empStatus: index(rule!EO_getEmpStatus(),"data",{}), local!empDetail: index(rule!EO_getEmpDetail(),"data",{})
I want to use the data of local!empStatus and local!empDetail into single read-only grid.
Discussion posts and replies are publicly visible
Hi ankitas0001
You can try something similar to this
load( local!empStatus: {{id:3,status:"Active"}, {id:2, status:"Active"}, {id:1, status: "Inactive"}}, local!empDetail: {{id:1,name:"ABC"}, {id:2, name:"PQR"}, {id:3, name: "LMN"}}, a!formLayout( label:"Form", contents:{ a!gridField( label:"Employee", totalCount: 3, columns: { a!gridTextColumn( label:"Name", data:local!empDetail.name ), a!gridTextColumn( label:"Status", data:a!forEach(local!empDetail,index(local!empStatus.status, wherecontains(fv!item.id,local!empStatus.id))) ) }, value: a!pagingInfo(startIndex: 1, batchSize: -1), saveInto: {}, identifiers:local!empDetail.id ) } ) )
But, as suggested by Mike, you can append the cdts in a local variable and then use that data subset. This will avoid the overuse of the looping function
Hi ankitab0001,
Thankyou for the time.
I have tried your scenario as well but i am getting an error as I want to use a!gridColumn (its a read only grid).
Regards,
Ankita Singh
Where exactly are you getting the error? The above code is also a read only field
FYI, if ankitas0001 is on 19.2+, your code will produce an error as you're using the old (deprecated) paging grid component format, but not referring to it as its new name a!gridField_19r2. I would suggest updating the code to reflect 19.2+, though, as it's a lot friendlier.