CellEditor in EditorGrid loses content when you scroll the grid
I have an issue where a user enters some data in an EditorGrid cell. Then the user scrolls the grid without clicking anywhere first. Upon scrolling, the edited cell gets reset and the entered data is lost. I recorded this behavior using the GXT editablegrid sample:
recording开发者_运维知识库: http://goo.gl/dqqhK
I am trying to prevent the entered data loss if the users scrolls. I have been experimenting with the CellEditor's onBlur(...) method, which is called when the users scrolls, but it seems that its FieldEvent argument has already lost the entered value. So the completeEdit() just stores nothing.
Is there any way that I can prevent that "data loss" when a user scrolls? Any help is greatly appreciated.
Thank you.
Thomas Amsler Sakai Project (UC Davis)
This works for me, hope it helps:
grid.addListener(Events.OnMouseWheel, new Listener<BaseEvent>() {
@Override
public void handleEvent(BaseEvent be) {
grid.stopEditing();
}
});
Events.BodyScroll works, because when you click up/down arrow of scroll bar or click anywhere of scroll bar is not a MouseWheel event.
I think this should be a GXT bug, hope it will be fixed in the future.
精彩评论