Skip to main content
kavyan471063
Known Participant
Jul 20, 2022 8:09 AM UTC
Question

Sorting issue in Grids

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
    Brainy
    Jul 20, 2022 8:20 AM UTC

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

    kavyan471063
    Known Participant
    Jul 20, 2022 9:20 AM UTC

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

    Also I am getting this error while sorting.

    Participating Frequently
    Jul 22, 2022 1:38 AM UTC

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