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
  • @roopeshr/harshav Hi, so I guess I am back with a solution. It might seem crazy to you but please do take a look at the code snippet attached here and try to improvise it as I have written it quite quickly. I have tested it and it worked like a charm for me.

    In short, I guess we can eliminate the error by handling the pagingInfo variable when there is a blank value or invalid value provided for the field which can be either intentional or by mistake.

    Below is the code at a high level and let's see what the community opines:
    a!save(
    local!pagingInfo,
    a!pagingInfo(
    startIndex: if(isnull(save!value.sort),local!pagingInfo.startIndex,if(length(save!value.sort.field)<=0,local!pagingInfo.startIndex,save!value.startIndex)),
    batchSize: if(isnull(save!value.sort),local!pagingInfo.batchSize,if(length(save!value.sort.field)<=0,local!pagingInfo.batchSize,save!value.batchSize)),
    sort: a!sortInfo(
    \ tfield: if(isnull(save!value.sort),local!pagingInfo.sort.field,if(length(save!value.sort.field)<=0,local!pagingInfo.sort.field,save!value.sort.field)),
    \ tascending: if(isnull(save!value.sort),local!pagingInfo.sort.field,if(length(save!value.sort.field)<=0,local!pagingInfo.sort.ascending,save!value.sort.ascending))
    \ t)
    )
    )
Reply
  • @roopeshr/harshav Hi, so I guess I am back with a solution. It might seem crazy to you but please do take a look at the code snippet attached here and try to improvise it as I have written it quite quickly. I have tested it and it worked like a charm for me.

    In short, I guess we can eliminate the error by handling the pagingInfo variable when there is a blank value or invalid value provided for the field which can be either intentional or by mistake.

    Below is the code at a high level and let's see what the community opines:
    a!save(
    local!pagingInfo,
    a!pagingInfo(
    startIndex: if(isnull(save!value.sort),local!pagingInfo.startIndex,if(length(save!value.sort.field)<=0,local!pagingInfo.startIndex,save!value.startIndex)),
    batchSize: if(isnull(save!value.sort),local!pagingInfo.batchSize,if(length(save!value.sort.field)<=0,local!pagingInfo.batchSize,save!value.batchSize)),
    sort: a!sortInfo(
    \ tfield: if(isnull(save!value.sort),local!pagingInfo.sort.field,if(length(save!value.sort.field)<=0,local!pagingInfo.sort.field,save!value.sort.field)),
    \ tascending: if(isnull(save!value.sort),local!pagingInfo.sort.field,if(length(save!value.sort.field)<=0,local!pagingInfo.sort.ascending,save!value.sort.ascending))
    \ t)
    )
    )
Children
No Data