Hello, using the 06-30-2011 Power nightly.
Browser: Firefox 5.0
OS: Mac OS X 10.6.8
I have an application with several listgrids. To all of those grids I want to add the offline view state capability.
The way the grids are initialized:
A few weird things happen:
1) Restoring the state happens incorrectly. It seems like all the fields are moved one spot.
2) Modifying one of the grids has the effect on ALL other grids. And yes, I do use a separate key for each grid!
See the attached screenshot for what is happening: here the columns are shifted one place to the right, and the expansion arrow is shown twice. (in other words: The word BP on the right column should be in the column in the middle)
Am I doing something wrong / should I initialize everything differently, or is this a bug?
Browser: Firefox 5.0
OS: Mac OS X 10.6.8
I have an application with several listgrids. To all of those grids I want to add the offline view state capability.
The way the grids are initialized:
Code:
grid.setAlternateRecordStyles(true); grid.setDataSource(dataSource); grid.setAutoFetchData(false); grid.setCanEdit(false); grid.setModalEditing(true); grid.setShowFilterEditor(true); grid.setDoubleClickDelay(30); grid.setListEndEditAction(RowEndEditAction.DONE); grid.setCanRemoveRecords(false); grid.setAutoSaveEdits(true); grid.setShowRecordComponents(true); grid.setShowRecordComponentsByCell(true); grid.setCanExpandRecords(true); grid.setFields(idField, companyNameField, deleteField); grid.hideField("Company_id"); companyNameField = this.setFormatterForcompanyName(companyNameField); companyNameField.setShowHover(false); grid.addFieldStateChangedHandler(new FieldStateChangedHandler(){ public void onFieldStateChanged(FieldStateChangedEvent event) { String viewState = grid.getViewState(); Offline.put("aGrid", viewState); } }); final String previouslySavedState = (String) Offline.get("aGrid"); if (previouslySavedState != null) { grid.addDrawHandler(new DrawHandler() { public void onDraw(DrawEvent event) { //restore any previously saved view state for this grid grid.setViewState(previouslySavedState); } }); } deleteField.setIcon(grid.getRemoveIcon()); deleteField.setType(ListGridFieldType.ICON); deleteField.setTitle(""); deleteField.setWidth(24); deleteField.setCanDragResize(false); deleteField.setCanSort(false); deleteField.setCanEdit(false); deleteField.setCanGroupBy(false); deleteField.setCanFreeze(false); deleteField.setCanFilter(false); deleteField.setCanHide(false); deleteField.setCanReorder(false); grid.addRecordClickHandler(new RecordClickHandler() { public void onRecordClick(RecordClickEvent event) { ListGridField clicked = event.getField(); final Record r = event.getRecord(); if ("deleteField".equals(clicked.getName())) { SC.confirm(radosMessages.delete_confirm(), new BooleanCallback() { public void execute(Boolean confirmed) { if (confirmed != null && confirmed) { grid.removeData(r); } else { //Cancel } } }); } } });
1) Restoring the state happens incorrectly. It seems like all the fields are moved one spot.
2) Modifying one of the grids has the effect on ALL other grids. And yes, I do use a separate key for each grid!
See the attached screenshot for what is happening: here the columns are shifted one place to the right, and the expansion arrow is shown twice. (in other words: The word BP on the right column should be in the column in the middle)
Am I doing something wrong / should I initialize everything differently, or is this a bug?
Comment