How to get the selected rows in all the pages of flexi grid.

How to get the selected rows in all the pages of flexi grid.

I need to get the all selected rows data from flexi gird.

Currently i'm using below logic to get the data.

var data = '';
            $("#gst tr td .selected").each(function(){
                if (this.checked) {
                    data+= ',' + this.value;
                }
            });

But it's only returning current page selected rows.
Any help\suggestion highly appreciated.

Thanks,
Balu