| org.zkoss.zul.RowRendererExt
All known Subclasses: org.zkoss.zkplus.databind.BindingRowRenderer,
RowRendererExt | public interface RowRendererExt (Code) | | Provides additional control to
RowRenderer .
author: tomyeh |
Field Summary | |
final public static int | DETACH_ON_RENDER Returned by
RowRendererExt.getControls to indicate
to detach the cell adde by
RowRendererExt.newCell . | final public static int | DETACH_ON_UNLOAD Returned by
RowRendererExt.getControls to indicate
whether to detach a rendered row when unloading it.
When a row has to be cleaned up
(so it can be re-rendered again), the grid
checks whether this flag is returned.
For example, when a new data model is assigned, all rendered rows
(i.e., generated by
RowRenderer.render ) will be cleaned up.
To have the best performance,
the grid, by default, keep using the same row and
the first cell (other cells, if any, are removed).
Sometimes it could be an issue. |
Method Summary | |
public int | getControls() Returns how a grid shall render the live data. | public Component | newCell(Row row) Create a component as the first cell of the row.
Note: remember to invoke
Component.applyProperties to
initialize the properties, defined in the component definition, properly,
if you create an instance instead of returning null.
Note: DO NOT call
Row.setParent .
If null is returned, the default cell is created as follow.
final Label cell = new Label();
cell.applyProperties();
return cell;
Note: DO NOT call
Component.setParent .
Don't create cells for other columns.
Parameters: row - the row. | public Row | newRow(Grid grid) Creates an instance of
Row for rendering. |
DETACH_ON_UNLOAD | final public static int DETACH_ON_UNLOAD(Code) | | Returned by
RowRendererExt.getControls to indicate
whether to detach a rendered row when unloading it.
When a row has to be cleaned up
(so it can be re-rendered again), the grid
checks whether this flag is returned.
For example, when a new data model is assigned, all rendered rows
(i.e., generated by
RowRenderer.render ) will be cleaned up.
To have the best performance,
the grid, by default, keep using the same row and
the first cell (other cells, if any, are removed).
Sometimes it could be an issue. For example, you assign attributes
or annotations to a rendered row.
Then, you'd better to return this flag to indicate that.
a new row shall be created (by calling
RowRendererExt.newRow and
RowRendererExt.newCell )
to replace the renderred row.
|
newCell | public Component newCell(Row row)(Code) | | Create a component as the first cell of the row.
Note: remember to invoke
Component.applyProperties to
initialize the properties, defined in the component definition, properly,
if you create an instance instead of returning null.
Note: DO NOT call
Row.setParent .
If null is returned, the default cell is created as follow.
final Label cell = new Label();
cell.applyProperties();
return cell;
Note: DO NOT call
Component.setParent .
Don't create cells for other columns.
Parameters: row - the row. It is the same as that is returnedby RowRendererExt.newRow the cell if you'd like to create it differently, or nullif you want Grid to create it for you |
newRow | public Row newRow(Grid grid)(Code) | | Creates an instance of
Row for rendering.
The created component will be passed to
RowRenderer.render .
Note: remember to invoke
Row.applyProperties to initialize
the properties, defined in the component definition, properly.
If null is returned, the default row is created as follow.
final Row row = new Row();
row.applyProperties();
return row;
Note: DO NOT call
Row.setParent .
the row if you'd like to create it differently, or nullif you want Grid to create it for you |
|
|