Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    SelectionAppearance.CHECKBOX

    Hi,

    I am using SmartGWT v3.0 , The problem described below happens in Chrome version 30.0.1599.101 and Firefox 25.0 but NOT in IE v9.0.8.112.16421

    The logic creates a grid that uses the built in CheckboxField and it overrides the createRecordComponent method. The problem is that I cannot select/deselect individual rows. I can however select/deselect the checkbox rendered in the header area and in so doing it will select or deselect all of the rows.

    I can tell you that if I do not use these properties: setShowRecordComponents(true), setShowRecordComponentsByCell(true) and I do not override the createRecordComponent method, the logic below works and I can select any row.

    Can someone please tell me what property I may be missing.

    lgMsg = new ListGrid() {
    @Override
    protected Canvas createRecordComponent(final ListGridRecord record, Integer colNum) {
    String fieldName = this.getFieldName(colNum);
    if (fieldName.equals(COL_MSG_DTTM_FLD)) {
    HLayout hlRecordCanvas = new HLayout(3);
    Label lblMsgDttm = new Label(record.getAttribute(COL_MSG_DTTM));
    lblMsgDttm.setValign(VerticalAlignment.CENTER);
    lblMsgDttm.setAlign(Alignment.RIGHT);
    lblMsgDttm.setWidth(30);
    lblMsgDttm.addClickHandler(new ClickHandler() {
    @Override
    public void onClick(ClickEvent event) {
    });
    }
    });
    hlRecordCanvas.setMembers(lblMsgDttm);
    return hlRecordCanvas;
    }
    else {
    return null;
    }
    }};
    lgMsg.setWidth100();
    lgMsg.setHeight100();
    lgMsg.setAlternateRecordStyles(true);
    lgMsg.setShowHeaderContextMenu(false);
    lgMsg.setShowEmptyMessage(false);
    lgMsg.setEmptyMessage("");
    lgMsg.setBodyOverflow(Overflow.SCROLL);
    gMsg.setLeaveScrollbarGap(true);
    lgMsg.setCanSort(false);
    lgMsg.setCanResizeFields(true);
    lgMsg.setFastCellUpdates(true);
    lgMsg.setCanFocus(false);
    lgMsg.setShowRollOver(false);
    lgMsg.setAutoFitFieldsFillViewport(false);
    lgMsg.setCellPadding(5);
    lgMsg.setShowRecordComponents(true);
    lgMsg.setShowRecordComponentsByCell(true);
    lgMsg.setSelectionType(SelectionStyle.SIMPLE);
    lgMsg.setSelectionAppearance(SelectionAppearance.CHECKBOX);
    lgMsg.setSelectionProperty(“isSelected”);

    Thanks
Working...
X