Improve smoothness of vertical scrolling.
This commit is contained in:
parent
16dc220273
commit
8e22037ae1
|
@ -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<Event>
|
||||
{
|
||||
/**
|
||||
* generated serial version ID
|
||||
|
@ -114,7 +114,7 @@ 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);
|
||||
|
||||
|
@ -123,6 +123,7 @@ public class GridPanel extends Borderlayout implements EventListener
|
|||
|
||||
//default true for better UI experience
|
||||
modeless = MSysConfig.getBooleanValue(MODE_LESS_KEY, true);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -351,7 +352,6 @@ public class GridPanel extends Borderlayout implements EventListener
|
|||
{
|
||||
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) {
|
||||
|
|
Loading…
Reference in New Issue