-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I've a custom grid and I'm using zul to define its column and row composition. I just want to be able to access the row renderer so that if a custom attribut is set to True, I will add a checkbox in front of the row.
When I get the Row in afterCompose they have not yet been rendered, so adding the checkbox then doesn't work.
I tried getting the default renderer but getRowRenderer() return null if the default is used. My idea was to add a wrapper renderer and on its render method add a checkbox to the row before calling the default renderer render method.
And everything is package or private, so annoying =/
Does anyone has an idea how to do that?
=> I want to add checkbox in front of row dynamicaly when a custom attribut of my grid is set to true while still using zul to define my grid layout.
Went with overriding the onInitRender method, was fairly simple in the end.
@Override
public void onInitRender() {
super.onInitRender();
if (withCheckbox) {
for (Component row : getRows().getChildren()) {
Checkbox checkbox = new Checkbox();
row.insertBefore(checkbox, row.getFirstChild());
}
}
}
Asked: 2016-02-09 14:12:34 +0800
Seen: 21 times
Last updated: Feb 10 '16
mvvm and template tag used?
chillworld ( 2016-02-09 14:26:38 +0800 )editI wanted to avoid impacting the zul / template of the grid.
WilliamB ( 2016-02-10 09:23:45 +0800 )edit