Hi All,
I am using a simple gridfield where I am constructing its data . I can't able to sort the columns. Label and data for the grid is based on a condition. I am attaching the code snippet and the inputs.
a!localVariables( local!unrecognizedPaging:a!pagingInfo(startIndex:1,batchSize:20), local!searchIdValuesUnrecognized:ri!searchIdValue, local!searchIdValuesUnrecognizedDs:todatasubset(ri!searchIdValue,local!unrecognizedPaging), a!gridField( data:todatasubset(local!searchIdValuesUnrecognizedDs,fv!pagingInfo), columns:{ a!gridColumn( label: if(ri!searchIdField = cons!GOS_CPD_IDENTIFIER_TEXT, "Compound ID", if(ri!searchIdField = cons!GOS_BAT_IDENTIFIER_TEXT, "Batch ID", "Batch Reference")), sortField:"cpdIdentifier", value:fv!row ) }, pageSize:2, pagingSaveInto:{fv!pagingInfo, a!save(local!unrecognizedPaging,fv!pagingInfo)}, selectionSaveInto: { local!unrecognizedPaging, a!save(local!searchIdValuesUnrecognizedDs, todatasubset(local!searchIdValuesUnrecognized, save!value)) } ) )
Inputs:
Can Anyone help with this.
Thanks & Regards,
Kavya
Discussion posts and replies are publicly visible
Why would you construct the Data subset on the interface when you'll be getting it from the query entity straight?
That was a single column grid where the data will be coming from user.
Also I am getting this error while sorting.
You need CDT/dictionary and identify the field to sort on.
Data subset can only contain complex data types. Not premitive. So you will need to construct a dictionary in which you can have a field like
{ compoundId: "Abc" }
And then you will be using this compoundId to pass as a field in the sortInfo parameter.