- performance enhancement: turn off grid stripe
This commit is contained in:
Heng Sin Low 2009-06-19 06:08:38 +00:00
parent 60143c031e
commit 336b9784f7
2 changed files with 31 additions and 4 deletions

View File

@ -32,10 +32,19 @@ public class Grid extends org.zkoss.zul.Grid
*/
private static final long serialVersionUID = -8286221761079570001L;
private boolean noStrip = false;
public void makeNoStrip() {
setStyle("border: none");
setOddRowSclass("even");
private String oddRowSclass;
public Grid() {
super();
//cache default
oddRowSclass = super.getOddRowSclass();
super.setOddRowSclass(oddRowSclass);
}
public void makeNoStrip() {
setStyle("border: none");
// setOddRowSclass("even");
setOddRowSclass(null);
noStrip = true;
}
@ -54,4 +63,21 @@ public class Grid extends org.zkoss.zul.Grid
}
return b;
}
@Override
public String getOddRowSclass() {
if (oddRowSclass == null)
return null;
else
return super.getOddRowSclass();
}
@Override
public void setOddRowSclass(String scls) {
if (scls != null && scls.length() == 0)
oddRowSclass = null;
else
oddRowSclass = scls;
super.setOddRowSclass(scls);
}
}

View File

@ -103,6 +103,7 @@ public class GridPanel extends Borderlayout implements EventListener
{
this.windowNo = windowNo;
listbox = new Grid();
listbox.setOddRowSclass(null);
south = new South();
this.appendChild(south);