PDA

View Full Version : LiveGridView with empty store



ionut.rachita
4 Mar 2011, 6:10 AM
Hi,

I have a LiveGridView which in some conditions has nothing to display. I have chosen this component because i'm trying to avoid to use a PagingToolBar. When there is nothing to display, the grid enters in infinite loop in which reloads data.
Is there a way to avoid this behaviour?

Ionut

ionut.rachita
7 Mar 2011, 9:04 AM
The solution found was to override isCached() and to remove "(liveStore.getCount() == 0)" condition:



@Override
protected boolean isCached(int index) {
if ((index < liveStoreOffset) || (index > (liveStoreOffset + getCacheSize() - getVisibleRowCount()))) {
return false;
}
return true;
}