74
Views
5
Comments
Solved
[OutSystems Data Grid] Selected rows does not persist after applying pagination.
outsystems-data-grid
Reactive icon
Forge asset by OutSystems
Application Type
Reactive

Hi,

I need to export selected rows but after applying pagination the row which was selected earlier gets deselected and all selected rows not getting downloaded.

please guide me for the same. 

Thanks,

Shivani

2022-08-03 04-32-50
Ravi Punjwani
Solution

@Shivani Rajoriya you can add a boolean variable in your data structure to store the IsSelected value additional to the feature available in the grid for fetching selected rows.

When a selection happens on the UI for any record (or multiple records), set the value of this IsSelected variable to True, this way you won't lose the values of row selections after you turn the pages away. The current dataset on the screen will hold the value of that variable.

So whenever the user wants to export the records, you will have your own set of values taken from IsSelected variable to filter only the selected rows, and send it for exporting.

2022-11-12 11-28-30
Gonçalo Martins
Staff
Solution

Hi @Shivani Rajoriya 

We're currently trying to include an improvement on the method in order to use the whole Grid and not the current page. You can follow this on future release notes under the code ROU-3936.

Cheers,
GM  

2022-08-03 04-32-50
Ravi Punjwani

Hi Shivani,

Please suggest if you're using server side paging or client-side.

I believe this won't be possible with server side pagination, unless you manage a separate logic to maintain a list ofrecords that were selected in previous pages.

If it's client-side paging, then you can just keep a track of selected items by filtering records using the boolean variable that controls the row selection.

Regards to which items not being downloaded, it is purely on the logic on how you consider which rows are selected. Once you fix your selected items problem in pagination, this will be automatically resolved since you'll have which items are selected by user, so only consider all those items when downloading anything from the grid.

2022-11-12 11-28-30
Gonçalo Martins
Staff

Hi. 
That's correct! The selection is applied at the page level since that's the context where you have access to data.

Cheers,
GM

2024-03-28 06-35-29
Shivani Rajoriya

Hi Ravi,

I am using the default pagination of grid, not the server side pagination.

Thanks

2022-11-12 11-28-30
Gonçalo Martins
Staff
Solution

Hi @Shivani Rajoriya 

We're currently trying to include an improvement on the method in order to use the whole Grid and not the current page. You can follow this on future release notes under the code ROU-3936.

Cheers,
GM  

2022-08-03 04-32-50
Ravi Punjwani
Solution

@Shivani Rajoriya you can add a boolean variable in your data structure to store the IsSelected value additional to the feature available in the grid for fetching selected rows.

When a selection happens on the UI for any record (or multiple records), set the value of this IsSelected variable to True, this way you won't lose the values of row selections after you turn the pages away. The current dataset on the screen will hold the value of that variable.

So whenever the user wants to export the records, you will have your own set of values taken from IsSelected variable to filter only the selected rows, and send it for exporting.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.