Hi,
I'm using an editable CubeGrid component to display data fetched from a JSON POSTMESSAGE RestDataSource using lazy loading (setAutoFetchData=true). The DataSource does not provide records for every displayed cell, since some facet combinations do not point to existing records.
If I add a new record using the API, an "add" operation is sent to the source URL but the grid is not refreshed, the cell remains blank !
It's working fine when the cell contains a value that was initially visible and the operation is rather an "update".
I checked the response of my data source which replies successfully with the new record attributes.
Here's the code of my update:
If I update the cell manually, everything is fine: the add operation is executed remotely and the grid is refreshed....
The only way I found to make the grid refresh is to call fetchData() after the updateData(...) call but it forces a complete refresh which is not what we want with a potentially big cube...
Can you help me understand what's going on here ??
Best regards,
SmartGWT 3.1p Power Edition + Analytics nightly 2013-01-27
GWT 2.5
Chrome
I'm using an editable CubeGrid component to display data fetched from a JSON POSTMESSAGE RestDataSource using lazy loading (setAutoFetchData=true). The DataSource does not provide records for every displayed cell, since some facet combinations do not point to existing records.
If I add a new record using the API, an "add" operation is sent to the source URL but the grid is not refreshed, the cell remains blank !
It's working fine when the cell contains a value that was initially visible and the operation is rather an "update".
I checked the response of my data source which replies successfully with the new record attributes.
Here's the code of my update:
Code:
for (int[] cellCoord : cubeGrid.getCellSelection().getSelectedCells()) { final int row = cellCoord[0]; final int col = cellCoord[1]; Record cell = cubeGrid.getCellRecord(row, col); FacetValueMap facetMap = cubeGrid.getCellFacetValues(row, col); // Check empty record boolean addRecord = (cell == null); if (addRecord) { cell = new CellRecord(); for (String facetId : facetMap.getFacetIds()) { cell.setAttribute(facetId, facetMap.getMapping(facetId)); } } updateCellRecord(facetMap, cell, type, textItemValue); if (addRecord) { cubeGrid.addData(cell); } else { cubeGrid.updateData(cell); } cubeGrid.refreshCell(row, col); }
The only way I found to make the grid refresh is to call fetchData() after the updateData(...) call but it forces a complete refresh which is not what we want with a potentially big cube...
Can you help me understand what's going on here ??
Best regards,
SmartGWT 3.1p Power Edition + Analytics nightly 2013-01-27
GWT 2.5
Chrome
Comment