Announcement

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

    Customize CheckBoxTrue/CheckBox False image for a paticular listGrid Field of ListGrid

    Hi,

    I am using SmartGWT version -->12.1-p20200423

    I am using ListGrid, by setting setSelectionAppearance(SelectionAppearance.CHECKBOX); i get checkbox in first Column.
    I am having a listGrid field whose dataSource is set to chckBox/boolean ,so i get the checkbox in that ListGrid Field ,but my requirement is to have different image for CheckBoxTrue/checkBoxFalse for this field only plus this field is editabltable too.

    I have attached a mockup for my requirement

    How can i achieve it.
    Attached Files

    #2
    See docs for listGridField.valueIcons.

    Comment


      #3
      Thanks for your reply.I have tried with foloowing code:

      final Map<String, String> valueIcons = new HashMap<>();
      valueIcons.put(Constants.FALSE_STRING, ComponentIcons.SLIDER_OFF);
      valueIcons.put(Constants.TRUE_STRING, ComponentIcons.SLIDER_ON);
      autosizeField.setValueIcons(valueIcons);
      autosizeField.setShowValueIconOnly(true);
      autosizeField.setCanFilter(false);
      autosizeField.setValueIconWidth(65);
      autosizeField.setValueIconHeight(18);
      autosizeField.setWidth(100);
      autosizeField.setCanEdit(true);
      autosizeField.setCanToggle(true);

      By default it is showing my new icons but when i click on icon , it shows smartGWT default checkBox images.

      Please help.
      Attached Files

      Comment


        #4
        Do you mean when editing? You would also need to configure the editor uses for the cell (CheckboxItem by default).

        Comment

        Working...
        X