Hi Everyone, We are seeing some strange behavior when we are populati

Certified Lead Developer
Hi Everyone,

We are seeing some strange behavior when we are populating a grid using a queryEntity inside of the with instead of a todatasubet. If we sort on a column that has all of the same data on the first page, and the same data on a couple rows on the second page, there are some rows that are never actually displayed on the grid. Our current theory is that this is occurring because there is no secondary sort field with a queryEntity, and the videos that I will link to later seem to support that. It looks like a query rule will have a secondary sort based on the "Sort query results by" configuration in the query rule itself if you change the pagingInfo.sortInfo that is passed into the query rule. Unfortunately, a queryEntity actually breaks if you pass it a pagingInfo that has an array of sortInfo, so I do not see a way to define, or force, a secondary sort field. According to documentation, it looks like sorting on multiple colum...

OriginalPostID-177486

OriginalPostID-177486

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    It's an interesting one, possible caused by the low cardinality of your sort field and the chaotic order of data that gets returned from an RDBMS when the sort field has such values. I've tested multiple a!sortInfo in a!queryEntity on 7.11 and it works but this will obviously be overwritten when clicking on a column heading.
    Here's something funky you could try, when clicking on the column heading you could append an additional sort column (such as the primary key field) to your paginginfo so that you always have multiple column sorting in your grid.
    Below are the value and saveInto attributes of your gridField:
    value: local!pagingInfo,
    saveInto: {
    local!pagingInfo,
    a!save(
    local!pagingInfo.sort,
    append(
    save!value.sort,
    a!sortInfo(
    field: "<your PK field>",
    ascending: true
    )
    )
    )
    }
Reply
  • 0
    Certified Lead Developer
    It's an interesting one, possible caused by the low cardinality of your sort field and the chaotic order of data that gets returned from an RDBMS when the sort field has such values. I've tested multiple a!sortInfo in a!queryEntity on 7.11 and it works but this will obviously be overwritten when clicking on a column heading.
    Here's something funky you could try, when clicking on the column heading you could append an additional sort column (such as the primary key field) to your paginginfo so that you always have multiple column sorting in your grid.
    Below are the value and saveInto attributes of your gridField:
    value: local!pagingInfo,
    saveInto: {
    local!pagingInfo,
    a!save(
    local!pagingInfo.sort,
    append(
    save!value.sort,
    a!sortInfo(
    field: "<your PK field>",
    ascending: true
    )
    )
    )
    }
Children
No Data