I am using Sencha GXT Grid for a web app. But what I see is after scrolling the grid the selection is gone. I tried to preserve the selection by catching the scroll event and restoring the selected items (using setsecteditems() ). But was not successful also. Is there a method to preserve the selection in sencha GXT grid. Thanx
I have finally able to preserve the selection in Live grid view. I found two ways that I thought worth to share.It's kind of a hack :) 1. If you are receiving data from a server. You can maintain a boolean in server side data preserving the selection. and when you render rows in the client side you can add a style name to that row checking the boolean which is set previously. the style name can be set using
grid.getView().setViewConfig(new GridViewConfig() {
@Override
public String getColStyle(Object model, ValueProvider<? super Data, ?> valueProvider, int rowIndex, int colIndex) {
return null;
}
@Override
public String getRowStyle(Objectmodel, int rowIndex) {
//Do the logic here and return the Style name
return null;
}
});