Announcement

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

    Autofit groupTitle field on list grid

    smartgwt 2.5
    Firefox 3.6.17

    I am using a ListGrid that starts by default being grouped by a single field. Then the user can group by another field to accomplish two levels of grouping. To do this I just call:

    listGrid.groupBy(newGroupByFields)

    where new GroupByFields is of length > 1. The grouping happens just fine. The only issue is that the groupTitle column is only sized as wide as the values of the first level of grouping so the groupTitles for the second level are being cut off. I can manually resize the column to see the new group titles, but it would be nice if the group title column would resize to fit the new level of titles. I have tried the following:

    setting these options on the list grid:

    setAutoFitWidthApproach(AutoFitWidthApproach.BOTH);
    setAutoFitWidth("groupTitle", true);

    setting this option on the list grid:

    setAutoFitData(Autofit.HORIZONTAL);

    invoking:

    listgrid.refreshFields(); // I have done this both by it self and in combination with the above settings.

    None of these approaches seem to have any affect on the width of the column. Is this functionality available in smartgwt?

    #2
    The normal behavior for grouping is that group rows span the whole grid so aren't clipped. You may have set showGroupTitleColumn:false, in which case, revert this setting to it's default to ensure the gropu title is visible.

    Comment


      #3
      Originally posted by Isomorphic
      The normal behavior for grouping is that group rows span the whole grid so aren't clipped. You may have set showGroupTitleColumn:false, in which case, revert this setting to it's default to ensure the gropu title is visible.
      That doesn't look like the issue. I am seeing the group title column just some of the contents are being cut off some. Just in case I went into the code and set it explicitly to true:
      setShowGroupTitleColumn(true);
      setShowGridSummary(true);
      setShowGroupSummaryInHeader(true);
      setShowGroupSummary(true);
      The problem still remains. I have attached a view of the problem both with the group titles being cut off at the second level of grouping and how it should look(which I got my manually resizing the group column).
      Attached Files

      Comment


        #4
        Sorry, to clarify, showGroupTitleColumn:false will dedicate an entire row to group titles so there will be no clipping.

        Comment


          #5
          I tried setting it explicitly to false this time and still no change. Were you able to look at the screen shots I attached to the issue to see what I am talking about? I get the group summaries in the header like I want but the column for the group titles does not fit to accomodate the second level of grouping.

          Comment


            #6
            Yes, we looked at the screenshots and they seem to clearly indicate you're not using the setting we pointed out :)

            Take any sample and just add 2+ column grouping and it renders with no clipping on the group titles.

            Comment


              #7
              Okay I did exactly as you said and grabbed one of the samples out of the show case with the country flags. I made up some data and am able to reproduce my issue with out a problem. When the page loads at first with the grid grouped by countryName the group title column is sized appropriately. When I click the button and it invokes the countryGrid.groupBy("capital", "continent") the table groups by those columns and chops off part of the continent name. If I set showGroupTitleColumn to false it just doesn't show the group titles at all which is not what I want. I want the group titles shown but with enough space in the column to not clip the titles. Please try the example code I have attached to see the issue.
              Attached Files

              Comment


                #8
                Um.. this again sets showGroupTitleColumn:true. Set it to *false* to use the whole row for the group title.

                Comment


                  #9
                  I don't know if you read my last comment completely or not. I stated that I tried it with that setting to be true and also false when I set it to false the group titles don't show at all. Let me provide you with a screen shot. And the updated java file. The only change I have made here is that now that setting is set to false like you claim will fix my problem. And Like I said before it doesn't fix the problem I am hoping to fix it just doesn't show the group title any more which is not a solution.
                  Attached Files

                  Comment


                    #10
                    Have you looked at the docs for showGroupSummaryInHeader? This also forces multiple columns instead of the default single column-spanning display.

                    Comment


                      #11
                      Yes I realize that the show summary in header makes it so there are multiple columns in the header which is what I want. I want to show the summary values in the header like I showed in the example. I would like both summary headers and for the listgrid to correctly expand to fit multiple levels of grouping labels in the group title column. It correctly resizes the group title column to fit one level of grouping but not multiple levels as you will see if you run the example.

                      Comment


                        #12
                        OK, for completeness: autoFit won't work when the grouping row has multiple columns. This is why we suggested using settings that dedicate a full row to the group title if it's important that it not be clipped. This is still the recommendation.

                        Comment


                          #13
                          I have the same issue of clipping group title when i have first 2 fields in list grid (frozen). it seems that column span just up to frozen column and first 2 fields have small width then make the group title to be clipped.

                          Please help

                          Comment

                          Working...
                          X