Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

SOLUTION: Flicker free ListGrid re-fetch

$
0
0
I'm searching a slution for weeks, for an absolutely flicker free ListGrid periodical refreshing. Tested, and working with big-big datasource (POST+JSON), with paging, without loading message and ListGrid remains scrollable.

I hope, my solution is helps some developer:
Code:

csoportDS = new DataSource(); //Or RestDataSource
...
listResztvevok = new ListGrid();
listResztvevok.setLoadingDataMessage("");
listResztvevok.setDataSource(csoportDS);
...
        public void Refresh() {
                DSRequest request=new DSRequest();
                //Adjust start and end Row
                int startRow=listResztvevok.getVisibleRows()[0];
                int endRow=listResztvevok.getVisibleRows()[1];
                if (startRow<0) {
                        startRow=0;
                        endRow=75;
                }
                if (endRow<startRow) endRow=startRow+75;
                request.setStartRow(startRow);
                request.setEndRow(endRow);
                csoportDS.fetchData(null,new DSCallback() {
                                Record[] responseData=new Record[dsResponse.getTotalRows()];
                                java.lang.System.arraycopy(dsResponse.getData(),0,responseData,dsResponse.getStartRow(),dsResponse.getData().length);
                                listResztvevok.setData(responseData);
                        }
                },
                request);
       
        }


Viewing all articles
Browse latest Browse all 4756

Trending Articles