The criteria seem not to work, since I am getting all records back, ignoring setInitialCriteria().
Edit: fetchData(c) seems to work. But setInitialCriteria() not ?
TestingModule:
Using smartgwt 6.0p 06.04 power
Edit: fetchData(c) seems to work. But setInitialCriteria() not ?
TestingModule:
Code:
public void onModuleLoad() { VStack vStack = new VStack(20); vStack.setWidth100(); final TileGrid tileGrid = new TileGrid(); tileGrid.setTileWidth(158); tileGrid.setTileHeight(225); tileGrid.setHeight(400); tileGrid.setID("boundList"); tileGrid.setCanReorderTiles(true); tileGrid.setShowAllRecords(true); tileGrid.setDataSource(AnimalXmlDS.getInstance()); tileGrid.setAutoFetchData(true); tileGrid.setAnimateTileChange(true); DetailViewerField commonNameField = new DetailViewerField("commonName"); commonNameField.setCellStyle("commonName"); DetailViewerField lifeSpanField = new DetailViewerField("lifeSpan"); lifeSpanField.setCellStyle("lifeSpan"); lifeSpanField.setDetailFormatter(new DetailFormatter() { public String format(Object value, Record record, DetailViewerField field) { return "Lifespan: " + value; } }); DetailViewerField statusField = new DetailViewerField("status"); tileGrid.setFields(commonNameField, lifeSpanField, statusField); vStack.addMember(tileGrid); Criteria c = new Criteria(); c.addCriteria("status", "Not Endangered"); tileGrid.setInitialCriteria(c); HLayout hLayout = new HLayout(10); hLayout.setHeight(22); vStack.addMember(hLayout); vStack.draw(); }
Comment