Announcement

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

    Hide Group Header in Listgrid

    1. SmartGWT Power 2.4

    2. How to hide the group header in listgrid. I would like to see only the group separater line and hide the headerdisplayed above the line for all the groups in listgrid.

    #2
    Just to confirm - you want there to be no text at all describing the group?

    Comment


      #3
      yes. it will looks like blue line and set of records and blue line and so on.

      Comment


        #4
        Very strange. Well, you can override getGroupTitle() to always return the empty String ("").

        Comment


          #5
          Do we able to remove the entire line. The setGroupTitle only makes the title bank. By removing the entire row, we can able get additional rows for display and the users does not want to see an extra layer of row. They need to see grouping (colapsing or expanding) the + or - sign.

          Comment


            #6
            You can get close to this by setting fixedRecordHeights:false so rows autofit to content and also setting a short cellHeight (eg 13), then removing the group title as previously indicated. Then the row would be about as tall as the expand/collapse control. If that's not close enough, we'd recommend implementing your own grouping interface, as we don't really consider it generally useful to have groups with no labels.

            Comment


              #7
              it is strange requirements from our business team. Thanks for your inputs. let me try and let you know the if it works.

              Comment


                #8
                I am creating a ListGrid as below by passing 2 as the input parameter.

                rGrid = getMyGrid(2);
                rGrid.setGroupStartOpen(GroupStartOpen.ALL);
                rGrid.setGroupByField("PRD_XLINK_MATCH_NAME");
                rGrid.redraw();
                rGrid.setDataSource(DataSource.get("T_CAT_DEMAND_REVIEW"));
                getResShowDiffColumn();
                rGrid.getField("PRD_XLINK_MATCH_NAME").setGroupTitleRenderer(new GroupTitleRenderer() {
                public String getGroupTitle(Object groupValue, GroupNode groupNode,
                ListGridField field, String fieldName, ListGrid grid) {
                return "";
                }

                });
                rGrid.hideField("PRD_XLINK_MATCH_NAME");
                ==========================================
                Creating the Grid:

                private ListGrid getMyGrid(int n) {
                ListGrid grid = new ListGrid();
                grid.setAlternateRecordStyles(true);
                grid.setShowFilterEditor(true);
                if(n == 0) {
                grid.setSelectionType(SelectionStyle.SIMPLE);
                grid.setSelectionAppearance(SelectionAppearance.CHECKBOX);
                } else if (n == 1) {
                grid.setSelectionType(SelectionStyle.SINGLE);
                grid.setSelectionAppearance(SelectionAppearance.ROW_STYLE);
                } else {
                grid.setFixedRecordHeights(false);
                grid.setCellHeight(5);
                }
                grid.setAutoFitFieldWidths(true);
                grid.setAutoFetchData(true);
                grid.setAutoFitWidthApproach(AutoFitWidthApproach.BOTH);
                return grid;
                }


                Please let me know if I miss something. Still I am not able to minimize to expand/collapse level.

                Comment


                  #9
                  So far this code doesn't apply any of the settings we just recommended.

                  Comment


                    #10
                    I applied the changes you have stated as below:

                    grid.setFixedRecordHeights(false);
                    grid.setCellHeight(5);


                    I am setting the input as 2 so that it will execute this two lines. Please correct me what needs to be done.

                    Comment


                      #11
                      These settings do only what we said they would - shrink to the size of the expand/collapse control (plus any padding or borders). If you want to smaller, remove any padding or borders from the style for this row, and to go further yet, replace the expand/collapse control with something smaller.

                      Comment

                      Working...
                      X