I am familar with getOffsetHeight and getElement.getClientHeight. The problem is I can't find when to call these methods to get the rendered height of my CellTable. I've tried adding an attach handler, row change handler, and overriding setRowData. I'm basically shooting around in the dark and wondering if any GWT experts can help me find out when to call those methods to get the correct height.
I'm trying to put the CellTable in a G-mail contextual gadget then change the height of the gadget using the dynamic height feature, FYI.
I had a similar issue with a CellList. I managed to solve it listening for load state changes. Basically this code is called every time the list/table is updated:
taskList.addLoadingStateChangeHandler(new LoadingStateChangeEvent.Handler() {
@Override
public void onLoadingStateChanged(LoadingStateChangeEvent event) {
if(event.getLoadingState() == LoadingState.LOADED) {
//Calculate height here
}
}
});
Hope this helps.
You can try to use the scheduleDeferred:
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
public void execute() {
//calculate height
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With