Using SmartGWT nightly build revision 1145. Running in GWT debug mode on Firefox 3.5.9 on Fedora 11. GWT 2.0.3
I'm trying to combine the "Live Grid" and "Grid Cell Widgets" demos from the showcase and I'm running into a drawing problem in which the widgets I create get drawn in the wrong cell (see attached).
The problem seems to be caused when the ListGrid attempts to render rows off-screen as you scroll to them. If I ensure all rows are pre-rendered by calling
the problem goes away, though that isn't a practical workaround obviously.
The relevant code snippets are:
I'm trying to combine the "Live Grid" and "Grid Cell Widgets" demos from the showcase and I'm running into a drawing problem in which the widgets I create get drawn in the wrong cell (see attached).
The problem seems to be caused when the ListGrid attempts to render rows off-screen as you scroll to them. If I ensure all rows are pre-rendered by calling
Code:
setDrawAheadRatio(100.0f)
The relevant code snippets are:
Code:
grid.setAutoFetchData(true); grid.setAlternateRecordStyles(true); grid.setShowRecordComponents(true); grid.setShowRecordComponentsByCell(true); grid.setDataSource(dataSource); . . . // In the class I inherited from ListGrid @Override protected Canvas createRecordComponent(final ListGridRecord record, Integer colNum) { String fieldName = this.getFieldName(colNum); if (fieldName.equals("actions")) { IButton button = new IButton(); button.setHeight(18); button.setWidth(85); button.setIcon("icons/tux.png"); button.setTitle(record.getAttribute("id") + " " + colNum); button.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { SC.say(" info button clicked."); } }); return button; } else { return null; } }
Comment