Sorry, no, that was a feature not a fix.
You can use DataChanged and selectRecord() to do the same thing yourself if you are trying to stay on 3.1 a bit longer.
Announcement
Collapse
No announcement yet.
X
-
Could you please add it also to smartgwt-3.1p?Originally posted by Isomorphic View PostAs of the next nightly build (May 17th), there will be a new boolean attribute available on listGrids - "reselectOnUpdate". When set to true (the default), updated data will be automatically re-selected (if the original record was selected within the result set when an update operation completes).
This change is available in the 9.0d branch
We just wanted to use it now and realized that was added to smartclient-9.0d and not to 8.3p.
Thank you
Leave a comment:
-
Thank you ! The solution with "cellMouseDown" handler worked.
Regards,
Fero
Leave a comment:
-
Ok - you should be able to resolve this as follows:
Add a "cellMouseDown" handler to your grid. This will provide a notification which you can use to both toggle the value, and suppress the default behavior (selecting the row the user clicks)
Within this handler, check whether the user clicked in the boolean column. If so, call setEditValue(...) to toggle the value of your boolean field, and then saveAllEdits() to save the value.
Cancel the event to suppress the normal selection of the clicked row.
Note that you may need canEdit set to true, but you should have editEvent set to "none" to suppress default behavior of entering normal edit mode on click or doubleClick.
Let us know if that doesn't allow you to get things working.
Regards
Isomorphic Software
Leave a comment:
-
I am not setting selectionApperance. I am using setCanToggle(true). But record is still highlighted. Tested with the latest nightly build (3.1p) and Firefox 18.0.2.Originally posted by Isomorphic View PostYes - don't setSelectionAppearance(checkbox) if that isn't what you want.
Instead, just add a boolean column of your own and setCanToggle(true) on it
Leave a comment:
-
Yes - don't setSelectionAppearance(checkbox) if that isn't what you want.
Instead, just add a boolean column of your own and setCanToggle(true) on it
Leave a comment:
-
Hi, i tried http://smartclient.com/builds/SmartGWT/3.1p/PowerEdition/2013-05-17 and i cannot find this flag on listgrid.
Also my problem was not about reselecting records after update. My problem is to not select at all record when only checkbox is checked. So again:
My gird is not editable. Only one column (checkbox one) should be. Therefore i am using memberG8Field.setCanEdit(true); and countryGrid.setAutoSaveEdits(false);
You can see (on the showcase) when you click on checkbox that related record is also highlighted.
My question is: Can i forbid to select (highlight) record if user only checked/unchecked checkbox ?
Leave a comment:
-
The problem here is a subtle one. When a record is updated in the dataSource backing a listGrid, the updated record is automatically folded into the data set for the grid.
If the original record was marked as selected, this selection is lost.
This is a longstanding behavior, but we acknowledge it can be frustrating and as such have made a change to address this. As of the next nightly build (May 17th), there will be a new boolean attribute available on listGrids - "reselectOnUpdate". When set to true (the default), updated data will be automatically re-selected (if the original record was selected within the result set when an update operation completes).
This change is available in the 9.0d branch
Regards
Isomorphic Software
Leave a comment:
-
A quick note to let you know we are looking at this.
Regards
Isomorphic Software
Leave a comment:
-
Hi again,
not sure if i explain correctly what i need. So i am posting modified showcase GridMassUpdateSample.
My gird is not editable. Only one column (checkbox one) should be. Therefore i am using memberG8Field.setCanEdit(true); and countryGrid.setAutoSaveEdits(false);Code:public Canvas getViewPanel() { Canvas canvas = new Canvas(); final ListGrid countryGrid = new ListGrid(); countryGrid.setWidth(500); countryGrid.setHeight(224); countryGrid.setCellHeight(22); countryGrid.setDataSource(CountryXmlDS.getInstance()); ListGridField nameField = new ListGridField("countryName", "Country"); ListGridField continentField = new ListGridField("continent", "Continent"); ListGridField memberG8Field = new ListGridField("member_g8", "Member G8"); //memberG8Field.setCanToggle(true); memberG8Field.setCanEdit(true); ListGridField populationField = new ListGridField("population", "Population"); populationField.setType(ListGridFieldType.INTEGER); populationField.setCellFormatter(new CellFormatter() { public String format(Object value, ListGridRecord record, int rowNum, int colNum) { if(value == null) { return null; } NumberFormat nf = NumberFormat.getFormat("0,000"); try { return nf.format(((Number) value).longValue()); } catch (Exception e) { return value.toString(); } } }); ListGridField independenceField = new ListGridField("independence", "Independence"); countryGrid.setFields(nameField,continentField, memberG8Field, populationField, independenceField); countryGrid.setAutoFetchData(true); countryGrid.setAutoSaveEdits(false); canvas.addChild(countryGrid); return canvas; }
You can see (on the showcase) when you click on checkbox that related record is also highlighted.
My question is: Can i forbid to select (highlight) record if user only checked/unchecked checkbox ?
Calling memberG8Field.setCanToggle(true); does not help me.
Regards
FeroLast edited by geletkaf; 4 May 2013, 03:12.
Leave a comment:
-
Sounds like what you want is basically not selection at all. By adding another field of type "boolean" to your grid and setting canToggle:true, you'll have a field showing clickable checkboxes which is unrelated to selection.
Leave a comment:
-
Cancel SelectionEvent in ListGrid
Hi.
ListGrid with some fields and one field defined as boolean. In the UI it is displayed as check-box (it will be used to collect records for mass or bulk update operation).
We don't want to use this code(business requirements reasons):
What I want to achieve is to not highlight record if user only check a checkbox in listgrid.Code:grid.setSelectionType(SelectionStyle.SIMPLE); grid.setSelectionAppearance(SelectionAppearance.CHECKBOX);
The reason is, that under listGrid we have detailviewer with additional data related to selected (highlighted) record -> and we do not want to always fetch this additional data only when checkbox was checked/unchecked.
Is this possible ? Can i somehow distinguish if only checkbox cell was clicked and then cancel SelectionEvent.
Regards,
FeroTags: None
Leave a comment: