I'm using the June 4 nightly build. I have a ListGrid with a view only field and a conditionally editable field. I'm also using SelectionAppearance.CHECKBOX and I want the user to be able to select multiple rows. The problem is, when I click on a field where the conditionally editable field is editable, it de-selects other rows that have already been selected. If I click on a row where the conditionally editable field is NOT editable I'm able to select multiple rows.
Here is my grid setup code ...
Here is the data source ...
And here is my test data ...
Here is my grid setup code ...
Code:
conditionsGrid = new ListGrid() { @Override protected boolean canEditCell(int rowNum, int colNum) { ListGridRecord record = conditionsGrid.getRecord(rowNum); return record.getAttributeAsBoolean("CaptureValue"); } }; conditionsGrid.setDataSource(termsAndConditionsDS); conditionsGrid.setWrapCells(true); conditionsGrid.setEditEvent(ListGridEditEvent.CLICK); conditionsGrid.setCanEdit(true); conditionsGrid.setFixedRecordHeights(false); conditionsGrid.setAutoFetchData(true); conditionsGrid.setShowHeader(false); ListGridField groupField = new ListGridField("Group"); ListGridField descriptionField = new ListGridField("Description"); descriptionField.setWidth("80%"); descriptionField.setCanEdit(false); ListGridField valueField = new ListGridField("Value"); ListGridField captureValueField = new ListGridField("CaptureValue"); captureValueField.setHidden(true); valueField.setType(ListGridFieldType.TEXT); valueField.setWidth("20%"); groupField.setHidden(true); conditionsGrid.setFields( groupField, descriptionField, valueField ); conditionsGrid.setGroupByField("Group"); conditionsGrid.setSelectionAppearance(SelectionAppearance.CHECKBOX); conditionsGrid.setGroupStartOpen(GroupStartOpen.ALL); conditionsGrid.setWidth100(); conditionsGrid.setAutoFitData(Autofit.VERTICAL); conditionsGrid.setSelectOnEdit(true);
Code:
<DataSource ID="TermsAndConditions" clientOnly="true" testFileName="/ds/test_data/TermsAndConditions.data.xml"> <fields> <field name="id" title="id" type="sequence" hidden="true" primaryKey="true"/> <field name="Group" title="Group" type="text" length="60"/> <field name="Description" title="Description" length="256"/> <field name="CaptureValue" title="Capture value?" type="boolean" detail="true"/> <field name="Value" title="Value" type="text" length="20"/> </fields> </DataSource>
Code:
<List> <TermsAndConditions> <id>1</id> <Group>Domestic</Group> <Description>We reserve the right to take 2%-10 Days, 3% Warehousing </Description> <CaptureValue>false</CaptureValue> </TermsAndConditions> <TermsAndConditions> <id>2</id> <Group>Domestic</Group> <Description>All Shipments are F.O.B., Designated Locations </Description> <CaptureValue>false</CaptureValue> </TermsAndConditions> <TermsAndConditions> <id>3</id> <Group>Domestic</Group> <Description>This Order is subject to pre-production and production sample approval</Description> <CaptureValue>false</CaptureValue> </TermsAndConditions> <TermsAndConditions> <id>4</id> <Group>Domestic</Group> <Description>Fax shipping confirmation to YM Inc. (Sales) Import Dept: 416-789-8983</Description> <CaptureValue>false</CaptureValue> </TermsAndConditions> <TermsAndConditions> <id>5</id> <Group>Domestic</Group> <Description>Freight To:</Description> <CaptureValue>true</CaptureValue> </TermsAndConditions> <TermsAndConditions> <id>6</id> <Group>Domestic</Group> <Description>Will be paid by:</Description> <CaptureValue>true</CaptureValue> </TermsAndConditions> <TermsAndConditions> <id>7</id> <Group>Import</Group> <Description>F.O.B $ USA</Description> <CaptureValue>true</CaptureValue> </TermsAndConditions> <TermsAndConditions> <id>8</id> <Group>Import</Group> <Description>F.O.B $ CDN</Description> <CaptureValue>true</CaptureValue> </TermsAndConditions> <TermsAndConditions> <id>9</id> <Group>Import</Group> <Description>USA Quota CAT. & Cost</Description> <CaptureValue>true</CaptureValue> </TermsAndConditions> <TermsAndConditions> <id>10</id> <Group>Import</Group> <Description>C.N.F $ USA</Description> <CaptureValue>true</CaptureValue> </TermsAndConditions> <TermsAndConditions> <id>11</id> <Group>Import</Group> <Description>C.N.F $ CDN</Description> <CaptureValue>true</CaptureValue> </TermsAndConditions> <TermsAndConditions> <id>12</id> <Group>Import</Group> <Description>NET ROG</Description> <CaptureValue>true</CaptureValue> </TermsAndConditions> <TermsAndConditions> <id>13</id> <Group>Import</Group> <Description>CDN DUTY</Description> <CaptureValue>true</CaptureValue> </TermsAndConditions> <TermsAndConditions> <id>14</id> <Group>Import</Group> <Description>USA DUTY</Description> <CaptureValue>true</CaptureValue> </TermsAndConditions> </List>
Comment