Just started to play with SmartGWT (1.0b1) and experienced strange problem. Example code that creates grid:
While grid.setDataPageSize(ROW_COUNT) is commented the content of grid is partially wrong, seems as some rows repeated and some missing: there are rows (hereinafter I mention row by first column) 1x1..76x1, then it starts again from 2x1 and finishes on 724x1. Note that default value for dataPageSize is documented as 75.
Is there something wrong with my code?
Code:
final int COLUMN_COUNT = 25; final int ROW_COUNT = 1000; ListGrid grid = new ListGrid(); grid.setWidth(600); grid.setHeight(400); // grid.setDataPageSize(ROW_COUNT); ListGridField[] gridFields = new ListGridField[COLUMN_COUNT]; for (int i = 0; i < COLUMN_COUNT; i++) { gridFields[i] = new ListGridField("d" + i, 50); } grid.setFields(gridFields); DataSource dataSource = new DataSource(); dataSource.setClientOnly(true); DataSourceIntegerField keyField = new DataSourceIntegerField("id"); keyField.setPrimaryKey(true); keyField.setHidden(true); dataSource.addField(keyField); for (int i = 0; i < COLUMN_COUNT; i++) { dataSource .addField(new DataSourceTextField("d" + i, "#" + (i + 1))); } for (int i = 0; i < ROW_COUNT; i++) { ListGridRecord record = new ListGridRecord(); record.setAttribute("id", i); for (int j = 0; j < COLUMN_COUNT; j++) { record.setAttribute("d" + j, (i + 1) + "x" + (j + 1)); } dataSource.addData(record); } grid.setDataSource(dataSource); grid.setAutoFetchData(true); RootPanel.get().add(grid);
Is there something wrong with my code?
Comment