Skip to main content
April 24, 2025
Solved

Issue in editable grid bulk selection

  • April 24, 2025
  • 11 replies
  • 0 views

Hi All,

I am having editable grid with selection and implemented pagination also for that grid. For selection given primary key for id in gridRowLayout.

but issue is if I selected all records in first page by click on header level checkbox and and go to next page and select all rows there also in same manner then my first page all selected primary keys is replacing with second page selected primary keys instead of appending all the selected primary key.

Please help in this

Best answer by ganeshg0004

Thanks Vyshnavi, for the suggestion...

I have fixed this issue by applying a condition for "select all" and "deselect all" in the selection save into as per below

 selectionValue: local!selectedIndices,
        selectionSaveInto: a!save(
          local!selectedIndices,
          if(
            a!isNullOrEmpty(index(save!value,1,null)),
            difference(local!selectedIndices,local!gridData.data.id),
            if(
              length(wherecontains(local!gridData.data.id,tointeger(save!value)))=length(local!gridData.data),
              union(append(local!selectedIndices,a!flatten(save!value)),append(local!selectedIndices,a!flatten(save!value)))
              a!flatten(save!value)
            )
          )
        ),

11 replies

stefanhelzle0001
April 24, 2025

Did you consider to add a separate button to select all items across pages?

April 27, 2025

Thanks for the response, Stefan...

No, I am not using a separate button to select all; I am using the grid selection label level checkbox. Highlighted one

stefanhelzle0001
April 27, 2025

I know that you are not using the built in function. But did you consider to add a separate button?

mikes0011
Brainy
April 24, 2025

I would assume you can build some conditionality into your Selection Save Into, in order to check whether the save target already contains some value, and instead of overwriting it, append to it...

April 27, 2025

Thanks for the response, Mike...

I have tried to append instead of override. It is appending the next page selected all IDs, but when I try to deselect any row, that is not happening. It is always being selected. 

I tried like this.

selectionValue: local!selectedIndices,
        selectionSaveInto: if(
          a!isNullOrEmpty(local!selectedIndices),
          a!save(
            local!selectedIndices,
            a!flatten(save!value)
          ),
          a!save(
            local!selectedIndices,
            append(
              local!selectedIndices,
              a!flatten(save!value)
            )
          )
        )

April 28, 2025

Hi [mention:893891ade03646f9bc6f7898c7617fc9:e9ed411860ed4f2ba0265705b8793d05] 

The issue is with the "Select All" functionality. When you select all values using it and then navigate to the next page and select all again, it overrides the previously selected values. However, this issue does not occur if you manually select each value one by one, move to the next page, and continue the same process — in that case, the select and deselect functionality works as expected.

I would suggest the following options to resolve this:

  1. Build a custom "Select All" functionality.

  2. Alternatively, change the selection style to ROW_HIGHLIGHT.

selectionValue: local!selectedIndices,
selectionSaveInto: a!save(
          local!selectedIndices,
          a!flatten(save!value)
        ),
selectionStyle: "ROW_HIGHLIGHT"