Fail to sort data

Hi All,

We're facing while using Sail Grid. Please find problem explained below.Any help is much appreciated.

We're fetching the data using query record and that data is displayed in a Grid component.

Now when we try to sort the grid data by clicking on a column header then it fails to sort the data for that column and it remains sorted on the default sort info that we provided at the time of fetching data from query record.


For your reference please find sample code below. Many Thanks in advance.


=load(
local!pagingInfo: topaginginfo(1, 10),
with(
local!data: =queryrecord(
recordType: cons!COMPANY_AUDIT_LOG,
query: 'type!{www.appian.com/.../2009}Query'(
'selection|aggregation': 'type!{www.appian.com/.../2009}Aggregation'(
columns: {
'type!{www.appian.com/.../2009}AggregationColumn'(
field: "full_name",
alias: "label",
visible: true,
...

OriginalPostID-91648

OriginalPostID-91648

  Discussion posts and replies are publicly visible

Parents
  • Hi skumar, plz find the code below:
    load(
    local!pagingInfo: topaginginfo(1, 10),
    with(
    local!data: =queryrecord(
    recordType: cons!COMPANY_AUDIT_LOG,
    query: 'type!{www.appian.com/.../2009}Query'(
    'selection|aggregation': 'type!{www.appian.com/.../2009}Aggregation'(
    columns: {
    'type!{www.appian.com/.../2009}AggregationColumn'(
    field: "full_name",
    alias: "label",
    visible: true,
                                  isGrouping: true
    ),

    'type!{www.appian.com/.../2009}AggregationColumn'(
    field: "no_of_company_count",
    alias: "data",
    visible: true,
    aggregationFunction: "SUM"
    )
    }
    ),
               local!pagingInfo
    )
    ),
                        a!formLayoutColumns(
                                  instructions: "In this report we can view the # of companies created by the Analyst(s) during a Year / Month / Week in tabular as well as graphical view",
                                  columns:{          
                                            a!columnLayout(
                                                      contents: {
                                                                a!sectionLayout(
                                                                          firstColumnContents: {
                                                                                    load(
                                                                                              with(
                                                                                                        local!pagingInfo: topaginginfo(1,-1),
                                                                                                        'type!{www.appian.com/.../2009}Grid'(
                                                                                                                  totalCount: if(local!data.totalCount>0,local!data.totalCount,0),
                                                                                                                  instructions: "Test",
                                                                                                                  columns: {
                                                                                                                            if(local!data.totalCount>0,
                                                                                                                                      {
                                                                                                                                                'type!{www.appian.com/.../2009}GridTextColumn'(
                                                                                                                                                          label: "Analyst",
                                                                                                                                                          data: if(local!data.totalCount>0,index(local!data.data, "label", {}),{}),
                                                                                                                                                          field: "label"
                                                                                                                                                ),
                                                                                                                                                'type!{www.appian.com/.../2009}GridTextColumn'(
                                                                                                                                                          label: "# of Companies Created",
                                                                                                                                                          data: if(local!data.totalCount>0,index(local!data.data, "data", {}),{}),
                                                                                                                                                          field: "data"
                                                                                                                                                )
                                                                                                                                      },
                                                                                                                                      {
                                                                                                                                                'type!{www.appian.com/.../2009}GridTextColumn'(
                                                                                                                                                label: "Analyst",
                                                                                                                                                data: 0,
                                                                                                                                                field: "label"
                                                                                                                                                ),
                                                                                                                                                'type!{www.appian.com/.../2009}GridTextColumn'(
                                                                                                                                                label: "# of Companies Created",
                                                                                                                                                data: 0,
                                                                                                                                                field: "data"
                                                                                                                                                )
                                                                                                                                      }
                                                                                                                            )
                                                                                                                  },
                                                                                                                  value: local!pagingInfo,
                                                                                                                  saveInto: local!pagingInfo
                                                                                                        )
                                                                                              )
                                                                                    )          
                                                                          }
                                                                )
                                                      }
                                            )
                                  }
                        )
              )
    )
Reply
  • Hi skumar, plz find the code below:
    load(
    local!pagingInfo: topaginginfo(1, 10),
    with(
    local!data: =queryrecord(
    recordType: cons!COMPANY_AUDIT_LOG,
    query: 'type!{www.appian.com/.../2009}Query'(
    'selection|aggregation': 'type!{www.appian.com/.../2009}Aggregation'(
    columns: {
    'type!{www.appian.com/.../2009}AggregationColumn'(
    field: "full_name",
    alias: "label",
    visible: true,
                                  isGrouping: true
    ),

    'type!{www.appian.com/.../2009}AggregationColumn'(
    field: "no_of_company_count",
    alias: "data",
    visible: true,
    aggregationFunction: "SUM"
    )
    }
    ),
               local!pagingInfo
    )
    ),
                        a!formLayoutColumns(
                                  instructions: "In this report we can view the # of companies created by the Analyst(s) during a Year / Month / Week in tabular as well as graphical view",
                                  columns:{          
                                            a!columnLayout(
                                                      contents: {
                                                                a!sectionLayout(
                                                                          firstColumnContents: {
                                                                                    load(
                                                                                              with(
                                                                                                        local!pagingInfo: topaginginfo(1,-1),
                                                                                                        'type!{www.appian.com/.../2009}Grid'(
                                                                                                                  totalCount: if(local!data.totalCount>0,local!data.totalCount,0),
                                                                                                                  instructions: "Test",
                                                                                                                  columns: {
                                                                                                                            if(local!data.totalCount>0,
                                                                                                                                      {
                                                                                                                                                'type!{www.appian.com/.../2009}GridTextColumn'(
                                                                                                                                                          label: "Analyst",
                                                                                                                                                          data: if(local!data.totalCount>0,index(local!data.data, "label", {}),{}),
                                                                                                                                                          field: "label"
                                                                                                                                                ),
                                                                                                                                                'type!{www.appian.com/.../2009}GridTextColumn'(
                                                                                                                                                          label: "# of Companies Created",
                                                                                                                                                          data: if(local!data.totalCount>0,index(local!data.data, "data", {}),{}),
                                                                                                                                                          field: "data"
                                                                                                                                                )
                                                                                                                                      },
                                                                                                                                      {
                                                                                                                                                'type!{www.appian.com/.../2009}GridTextColumn'(
                                                                                                                                                label: "Analyst",
                                                                                                                                                data: 0,
                                                                                                                                                field: "label"
                                                                                                                                                ),
                                                                                                                                                'type!{www.appian.com/.../2009}GridTextColumn'(
                                                                                                                                                label: "# of Companies Created",
                                                                                                                                                data: 0,
                                                                                                                                                field: "data"
                                                                                                                                                )
                                                                                                                                      }
                                                                                                                            )
                                                                                                                  },
                                                                                                                  value: local!pagingInfo,
                                                                                                                  saveInto: local!pagingInfo
                                                                                                        )
                                                                                              )
                                                                                    )          
                                                                          }
                                                                )
                                                      }
                                            )
                                  }
                        )
              )
    )
Children
No Data