Announcement

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

    Add icon next to groupBy title

    I have a ListGrid where I do a groupby. I would like to add an icon for SOME of the groupBy titles (not all of them). Is there a way to do this in smartgwt?

    I am using (hope to start using 12.1p soon)

    SmartGwt 12.0p (v12.0p_2018-11-24/LGPL_Development_Only)
    Firefox 78.8
    GWT 2.8

    #2
    getGroupTitle() allows you to return HTML, so you can just return an <img> tag along with the title.

    Comment


      #3
      It doesn't appear the getGroupTitle() is getting called. Below is the code.

      ListGrid grid = new ListGrid() { @Override
      public String getGroupTitle() {
      return "Hello";
      }

      }

      grid.setGroupByField("category");
      grid.setGroupByASyncThreshold(2000);
      grid.setGroupByMaxRecords(2000);
      grid.setGroupStartOpen(GroupStartOpen.NONE);
      ListGridField name = new ListGridField("name", "Name");
      ListGridField category = new ListGridField("category", "Category");
      grid.setFields(category, name);

      // no datasource connected to the grid. It is populated manually by calling setData.
      grid.setData(mydata);

      Last edited by jlpuff@hotmail.com; 9 Jul 2021, 04:42.

      Comment


        #4
        Incorrect code, see docs and this sample.

        Comment


          #5
          Thank you for pointing me to the sample code. That worked for me. Thanks again!!

          Comment

          Working...
          X