Row selection Slow down in case of large data in NatTable [message #1413385] |
Thu, 28 August 2014 08:02  |
Eclipse User |
|
|
|
Hi All,
We have migrated the JTable in to Nattable in our RCP application. All functionalities are working fine with NatTable but we are facing some problem related to Performance. In case of large data (around 10000 record), To select last row it takes around 4 to 5 sec. Loading the table is not taking time. If we try to select first row it takes milliseconds and if we scroll down to last row and try to select then its takes 5 seconds. Also to open the context menu it takes 4 to 5 sec.
Please help us for the above issue.
Thanks in advance.
|
|
|
|
|
|
|
|
|
|
|
|
Re: Row selection Slow down in case of large data in NatTable [message #1417446 is a reply to message #1417444] |
Fri, 05 September 2014 09:03   |
Eclipse User |
|
|
|
Ok...
For that we have written the bolw code:
protected void addMouseRightClickBinding() {
tableComponent.getUiBindingRegistry().registerMouseDownBinding(
new MouseEventMatcher(GridRegion.BODY,
MouseEventMatcher.RIGHT_BUTTON), new IMouseAction() {
@Override
public void run(NatTable natTable, MouseEvent event) {
SelectRowGroupsAction selectrowgroup = new SelectRowGroupsAction();
ViewportSelectRowAction selectRowAction = new ViewportSelectRowAction(
false, false);
int rowPosition = LayerUtil.convertRowPosition(
natTable, natTable.getRowPositionByY(event.y),
selectionLayer);
if (!selectionLayer.isRowPositionSelected(rowPosition)) {
selectRowAction.run(natTable, event);
} else {
int sele = selectionLayer.getSelectedRowCount();
if (sele <= 1) {
selectRowAction.run(natTable, event);
} else if (sele > 1) {
selectrowgroup.run(natTable, event);
}
}
}
});
}
-----------------------------
It Solves our problem but not sure that its correct way or not. Please confirm.
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05598 seconds