Announcement

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

    GridCellItem Height

    Hi everybody,

    I'm trying to use Listgrid with complex datasource.

    Each cell of my grid must display a random number of box with multiple line(Room,Training Title,Begin hour,Trainee list).
    Example :
    Room 419
    Gwt lesson
    john Doe1
    John Doe2
    ...
    I know that its look like a calendar but this "calendar must display data for different trainer.
    Representation is defined by :
    Column : Trainers
    Row : Day
    For one day and one trainer we could have multiple box(as described before).

    I've looked the Multiline Values and the GridCellWidget example and I've tried to make a mix of these examples.

    In each cell I display data in a VerticalLayout.
    This data is an Html flow with span for texte.
    This flow is stored in a HtmlPane and the pane is included in the vertical layout.

    Data is displayed,but there is a problem with cell height.
    I use this code in order to support multiline cell :
    Code:
    grid.setWrapCells(true);   
    grid.setFixedRecordHeights(false);
    But my cells overflow other cells.

    Does the use of ListGrid a good idea in order to realise my application part?

    If you use widgets in cells, what do you do in order to display many item in a cell(verticaly)?

    I'm using SmartGwt 2.2 and Gwt 2.0.3
    Tested on Chrome 6 and Firefox 3.6

    #2
    I'm using SmartGwt 2.2 with Firefox 3.6.9.

    I'm seeing this same issue. Did you ever figure out how to deal with it?

    I'm creating an HTMLFlow as the record component in a ListGrid. I've set the two values as indicated above (WrapCells & FixedRecordHeight), and like the previous post, the content is displayed but the row height does not change to accommodate it. This causes it to cover cells above and below it.

    Comment


      #3
      Try upgrading to the next nightly build. There have been a lot of fixes and enhancements to cell widgets subsystem, including one just today that corrects an intermittent issue frozen columns.

      Comment


        #4
        Hi,
        In order to create my table I haven't used a smartgwt table but a scrollpane(incubator) because my deadline is in 2 days.

        Like "Isomorphic" said, try upgrading your smartgwt version to the latest nightly build and maybe the problem is corrected.

        Comment


          #5
          thanks for the suggestion.

          I just replaced the 2.2 jar with the 2.3 jar in the Eclipse project build path and ran. I'm still seeing the issue. Is there something else that needs to change in order to use the new version?

          If not, then I guess that didn't fix it. It's not a critical feature for me right now. So I'm not going to worry about it. Thanks for your help.

          Comment


            #6
            Not sure where you downloaded from, but nightly builds are here, and the full set of installation steps are here. Please let us know if you still have a problem after upgrading to a nightly, ideally, by posting a runnable test case.

            Comment


              #7
              I grabbed the zip file from here:
              http://www.smartclient.com/builds/SmartGWT/2.x/LGPL/2010-10-26/smartgwt-2.3.zip

              I used the jar file from in there in place of the 2.2 jar.

              Here's a code snippet showing what I did:
              Code:
                      @Override  
                      protected Canvas createRecordComponent(final ListGridRecord record, Integer colNum)    
                      {
                          String fieldName = this.getFieldName(colNum);
                          
                          Canvas recordComponent = null;
                          if (fieldName.equals(EditorEntry.TEXT_ATTR + FMT))
                          {
                              HTMLFlow html = new HTMLFlow("<b>" + record.getAttribute(EditorEntry.TEXT_ATTR) + "</b>");
                              html.setWidth100();
                              html.setHeight100();
                              recordComponent = html;
                          }
                          return recordComponent;
                      }
              This is in a class inheriting from ListGrid.

              As I said, this puts the new Canvas object in the grid cell, but the grid row does not resize to accommodate its height.

              Thanks.

              Comment


                #8
                Hi Scolgan,

                Is your listGrid showing frozen columns?
                We have a known limitation whereby frozen columns are not supported in conjunction with "virtualScrolling" (required for variable height recordComponents).
                If you do need to embed consistently-sized record components in a ListGrid with frozen columns, we've just added a new method "listGrid.setRecordComponentHeight(Integer height)" which causes the listGrid to render all rows tall enough to accommodate recordComponents of the specified height, and is supported in conjunction with frozen columns. (This method will be present in our next nightly build).


                If you're not showing any frozen columns but you're still seeing bad sizing behavior with recordComponents we'd be interested in seeing a test case (Ideally standalone example code we can drop into an entry point class and run on our end to reproduce the problems you're seeing)

                Comment

                Working...
                X