Hello,
I've found the following strange bug in SmartGWT 4.0p (latest nightly (29.08.2013)):
If the records of a TreeGrid have CellRecordComponents and a Node is Expanded the CellRecordComponent is not always shown (reproducable).
- This only happens with Datasources beeing NOT client-only
- This only happens in 4.0p not in 3.1p (tried the latest nightly (29.08.2013))
- This could be reproduced in Chrome and Firefox both up to date (I've not testet it in other browsers yet)
Here is the code for reproducing the problem:
You have to expand the 1st node. In 3.1p every new displayed child node will have an button as CellComponent, in 4.0p there will be the first four Buttons missed.
regards
Andreas
I've found the following strange bug in SmartGWT 4.0p (latest nightly (29.08.2013)):
If the records of a TreeGrid have CellRecordComponents and a Node is Expanded the CellRecordComponent is not always shown (reproducable).
- This only happens with Datasources beeing NOT client-only
- This only happens in 4.0p not in 3.1p (tried the latest nightly (29.08.2013))
- This could be reproduced in Chrome and Firefox both up to date (I've not testet it in other browsers yet)
Here is the code for reproducing the problem:
Code:
@Override public void onModuleLoad() { TreeGrid treeGrid = new TreeGrid() { @Override protected Canvas createRecordComponent(final ListGridRecord record, Integer colNum) { if (!"actions".equals(getFieldName(colNum))) { return null; } ImgButton button = new ImgButton(); button.setShowRollOver(true); button.setShowDown(false); button.setSrc("[SKIN]/actions/add.png"); button.setHeight(16); button.setWidth(16); return button; } }; treeGrid.setShowRecordComponents(true); treeGrid.setShowRecordComponentsByCell(true); treeGrid.setWidth(500); treeGrid.setHeight(400); treeGrid.setLoadDataOnDemand(true); DataSource ds = new DataSource() { { setID("test"); setDataProtocol(DSProtocol.CLIENTCUSTOM); setDataFormat(DSDataFormat.CUSTOM); DataSourceField parent = new DataSourceField("parent", FieldType.INTEGER); parent.setForeignKey("test.id"); DataSourceField id = new DataSourceField("id", FieldType.INTEGER); id.setPrimaryKey(true); setFields(id, parent); } @Override protected Object transformRequest(DSRequest request) { DSResponse response = new DSResponse(request.getDataSource()); response.setStatus(0); Criteria crit = new Criteria(request.getData()); Integer parent = crit.getAttributeAsInt("parent"); Record[] data = new Record[5]; for (int i = 0; i < data.length; i++) { data[i] = creatCat(parent == null ? 1 : parent, i); } response.setData(data); processResponse(request.getRequestId(), response); return null; } private Record creatCat(int parent, int count) { Record record = new Record(); record.setAttribute("parent", parent); record.setAttribute("id", parent * 10 + count); return record; } }; treeGrid.setDataSource(ds); treeGrid.setAutoFetchData(true); treeGrid.setFields( new TreeGridField("id"), new TreeGridField("actions", " ", 60) ); treeGrid.draw(); }
regards
Andreas
Comment