From 8e22037ae183ee42d854c9590c5186b311419186 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Wed, 18 Apr 2012 13:37:44 +0800 Subject: [PATCH] Improve smoothness of vertical scrolling. --- .../org/adempiere/webui/component/GridPanel.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/GridPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/GridPanel.java index af9b041f85..0cfc362572 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/GridPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/GridPanel.java @@ -52,7 +52,7 @@ import org.zkoss.zul.event.ZulEvents; * @author Low Heng Sin * */ -public class GridPanel extends Borderlayout implements EventListener +public class GridPanel extends Borderlayout implements EventListener { /** * generated serial version ID @@ -114,15 +114,16 @@ public class GridPanel extends Borderlayout implements EventListener { this.windowNo = windowNo; listbox = new Grid(); - listbox.setOddRowSclass(null); + listbox.addEventListener(ZulEvents.ON_AFTER_RENDER, this); south = new South(); this.appendChild(south); //default paging size pageSize = MSysConfig.getIntValue(PAGE_SIZE_KEY, 100); - + //default true for better UI experience modeless = MSysConfig.getBooleanValue(MODE_LESS_KEY, true); + } /** @@ -350,8 +351,7 @@ public class GridPanel extends Borderlayout implements EventListener else { south.setVisible(false); - } - + } } private void updateModel() { @@ -432,6 +432,11 @@ public class GridPanel extends Borderlayout implements EventListener onSelectedRowChange(0); } } + else if (event.getName().equals(ZulEvents.ON_AFTER_RENDER)) + { + //render all rows of active page to give smooth scrolling performance + listbox.renderAll(); + } } private void onSelectedRowChange(int index) {