Skip to main content
kavyan471063
Known Participant
July 20, 2022
Question

Sorting issue in Grids

  • July 20, 2022
  • 4 replies
  • 0 views

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

    4 replies

    harshitb6843
    July 20, 2022

    Why would you construct the Data subset on the interface when you'll be getting it from the query entity straight? 

    kavyan471063
    Known Participant
    July 20, 2022

    That was a single column grid where the data will be coming from user.

    Also I am getting this error while sorting.

    Participating Frequently
    July 22, 2022

    You need CDT/dictionary and identify the field to sort on.