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
|
* @author Low Heng Sin
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class GridPanel extends Borderlayout implements EventListener
|
public class GridPanel extends Borderlayout implements EventListener<Event>
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* generated serial version ID
|
* generated serial version ID
|
||||||
|
@ -114,15 +114,16 @@ public class GridPanel extends Borderlayout implements EventListener
|
||||||
{
|
{
|
||||||
this.windowNo = windowNo;
|
this.windowNo = windowNo;
|
||||||
listbox = new Grid();
|
listbox = new Grid();
|
||||||
listbox.setOddRowSclass(null);
|
listbox.addEventListener(ZulEvents.ON_AFTER_RENDER, this);
|
||||||
south = new South();
|
south = new South();
|
||||||
this.appendChild(south);
|
this.appendChild(south);
|
||||||
|
|
||||||
//default paging size
|
//default paging size
|
||||||
pageSize = MSysConfig.getIntValue(PAGE_SIZE_KEY, 100);
|
pageSize = MSysConfig.getIntValue(PAGE_SIZE_KEY, 100);
|
||||||
|
|
||||||
//default true for better UI experience
|
//default true for better UI experience
|
||||||
modeless = MSysConfig.getBooleanValue(MODE_LESS_KEY, true);
|
modeless = MSysConfig.getBooleanValue(MODE_LESS_KEY, true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -350,8 +351,7 @@ public class GridPanel extends Borderlayout implements EventListener
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
south.setVisible(false);
|
south.setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateModel() {
|
private void updateModel() {
|
||||||
|
@ -432,6 +432,11 @@ public class GridPanel extends Borderlayout implements EventListener
|
||||||
onSelectedRowChange(0);
|
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) {
|
private void onSelectedRowChange(int index) {
|
||||||
|
|
Loading…
Reference in New Issue