Disable sorting on one column only in a paging grid

I am currently working on a paging Grid. I want to achieve below functionality . Any help is appreciated .

-> I have around 10 columns . I just want to disable sorting on only one column and retain sorting on all other columns. Is there a way to achieve this . If Yes please share.

OriginalPostID-216660

OriginalPostID-216660

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    If you don't provide the field attribute to gridTextColumn() it will nullify the sort attribute of your pagingInfo and effectively reset your datasubset to the default of the query. It sounds like you want to retain whatever is the current sort value when this happens.

    You can use something like the following on the saveInto of the gridField() to 1st capture the current sort value and then test to see if the column the user clicked on contains the field attribute, if not just reuse the previous sort value rather than the new one:

    value: local!pagingInfo,
    saveInto: {
    a!save(
    local!sortInfo,
    local!pagingInfo.sort
    ),
    a!save(
    local!pagingInfo.startIndex,
    save!value.startIndex
    ),
    a!save(
    local!pagingInfo.batchSize,
    save!value.batchSize
    ),
    a!save(
    local!pagingInfo.sort,
    if(
    rule!APN_isBlank(
    save!value.sort.field
    ),
    local!sortInfo,
    save!value.sort
    )
    )
    }
Reply
  • 0
    Certified Lead Developer
    If you don't provide the field attribute to gridTextColumn() it will nullify the sort attribute of your pagingInfo and effectively reset your datasubset to the default of the query. It sounds like you want to retain whatever is the current sort value when this happens.

    You can use something like the following on the saveInto of the gridField() to 1st capture the current sort value and then test to see if the column the user clicked on contains the field attribute, if not just reuse the previous sort value rather than the new one:

    value: local!pagingInfo,
    saveInto: {
    a!save(
    local!sortInfo,
    local!pagingInfo.sort
    ),
    a!save(
    local!pagingInfo.startIndex,
    save!value.startIndex
    ),
    a!save(
    local!pagingInfo.batchSize,
    save!value.batchSize
    ),
    a!save(
    local!pagingInfo.sort,
    if(
    rule!APN_isBlank(
    save!value.sort.field
    ),
    local!sortInfo,
    save!value.sort
    )
    )
    }
Children
No Data