Announcement

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

    Unable to autofit CubeGrid

    Hi,

    I am having many issues with autofitting a cube grid. I tried many different things for a while, and nothing works. I want the cube grid to be autofitted such that the widths of all the fields fit both the header and data contents, but no larger. Please see the attached sample code in "BuiltinDS.java" and help me to fix these issues.

    1. The "2016_02_03.14_54" column is way too large. It seems like this issue is partly caused by cubeGrid.setHideEmptyFacetValues(true), but I am not sure why this would break the autofitting. We need to hide the columns that have empty values.
    2. The "PNR_StageName" and "ProjName_Revision/Block_Name/Layout_Rundir_Name/metric" columns are stuck at 100 pixels. I have not found any way to adjust this by any means, much less auto fit it, which is what I want. You can see how the text is clipped.

    I have tried both setAutoFitData() and autoFitFields(), and neither works properly. Thanks for your help. I am using the August 9 version of SmartGWT 6.1p.

    Screenshot illustrating the problem:

    Click image for larger version  Name:	cubegrid_autofit_issues.png Views:	3 Size:	35.7 KB ID:	249538
    Attached Files
    Last edited by user316; 6 Oct 2017, 15:50.

    #2
    I am attaching a screenshot of how I ideally want it to look. I manually adjusted the columns here with my cursor.

    Click image for larger version  Name:	cubegrid_autofit_ideal.png Views:	1 Size:	32.4 KB ID:	249536
    Last edited by user316; 6 Oct 2017, 15:46.

    Comment


      #3
      The CubeGrid doesn't have support for autofitting to header titles or to data. You are trying to turn on ListGrid-level properties which apply only to the ListGrid's very different header structure and data model. You instead control the width of facetValue headers by setting facetValue.width.

      Two approaches to get the kind of auto-fitting you want in a CubeGrid:

      1. measure the width of the titles with offscreen rendering and then apply those widths as facetValue.width settings

      2. sponsor CubeGrid autofitting features (which would essentially use the approach of #1 above)

      Note that CubeGrid doesn't currently support autofitting features because they are impractical at the data volumes typically shown in a CubeGrid. If you've decided on CubeGrid just to get stacked headers, and won't be using any of the advanced features beyond that (things like on-the-fly pivoting of data, drill-down through nested facets, cube-oriented charting), consider just using a ListGrid with headerSpans, where autofitting features are supported.

      Comment


        #4
        Hi,

        Is it possible to group the rows in the left-most column of the listgrid, and also have it frozen for scrolling? Basically we want vertical header-spans on the left of the grid. If we switch from a CubeGrid to a ListGrid (in order for autofit to work) we'd like to preserve this functionality if possible. See the red box of this cubegrid for example.

        Click image for larger version  Name:	example_left_header_grouping.png Views:	1 Size:	54.8 KB ID:	249566

        Edit: I think if it's not possible to have header-spans on the left, that's okay because we can just set the grouping to PNR_StageName and make them expandable folders.
        Last edited by user316; 9 Oct 2017, 07:00.

        Comment


          #5
          The ListGrid does not support multiple levels of spanning headers on the left-hand side of the grid, but does support multi-level grouping - just call groupBy() with multiple field names.

          Comment


            #6
            Thanks for letting me know. Anyways, I managed to fix the main autofit issues I was having in the CubeGrid by setting cubeGrid.setAutoFitFieldsFillViewport(false). So I will stick with the CubeGrid for now, even though autofit isn't officially supported.

            I have another question about the CubeGrid. I am trying to re-align these facet values of the rows. Do you know how I can do this? I tried a lot of things, both in the CSS styles and by setting various aligns for the facet values, grid, and facet, but nothing seems to work. They are currently center aligned by default, but I'd like to make them either right-aligned or left-aligned.

            See screenshot:

            Click image for larger version  Name:	facetvaluesalignment.png Views:	1 Size:	23.8 KB ID:	249606

            Comment


              #7
              Set facetValue.align.

              Comment

              Working...
              X