Announcement

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

    SmartGWT Vertical Scrollbar not rendering properly in Window

    Dear Isomorphic Administrator,
    We are working on a SmartGWT (version 6) ListGrid which has Image Data as one of its fields attached to VLayout, the Layout is added to a Window. We need to have a Vertical Scroll when the number of images are more than the visible area. This is very inconsistent in the sense some times the Vertical Scroll appears and sometimes not and also sometimes even when the datasource returns say 10 records not all records are rendered on the grid. please let us know your suggestions, snippet code for inspection as below:
    VLayout layout = new VLayout(); Window window = new Window();
    ListGrid grid = new ListGrid(); grid.setShowFilterEditor(false); grid.setDataSource(ds);
    //fields int numberOfColumns= 3; String[] fieldsName = new String[numberOfColumns]; fieldsName[0] = "CREATED_DATE"; fieldsName[1] = "IMAGE_SELECTION"; fieldsName[2] = "IMAGE_VALUES";
    String[] fieldsTitle = new String[numberOfColumns]; fieldsTitle[0] = "Created Date"; fieldsTitle[1] = "Image"; fieldsTitle[2] = "Attachment Type"; final ListGridField[] listGridField = new ListGridField[numberOfColumns];
    for (int i = 0; i < numberOfColumns; i++) { listGridField[i] = new ListGridField(fieldsName[i], fieldsTitle[i]); } listGridField[1].setAlign(Alignment.CENTER);
    grid.setFields(listGridField);
    grid.setBodyOverflow(Overflow.SCROLL);
    grid.setAutoFitData(Autofit.VERTICAL);
    layout.addMember(grid); window.addItem(layout);
    window.setCanDragResize(false);
    window.show();

    Specific Goal: Need to have a consistent vertical scroll bar and all the records to be rendered in the grid

    Thank you!

    #2
    This post is terribly incomplete (version, product, complete code, etc), but as a guess, you may be rendering out varying size images without providing any sizes, so there's no way for the framework to know how tall the rows are going to be. See dataSourceField.imageHeight/imageWidth - these properties allow *either* setting all images to the same size, or providing the image sizes dynamically as field values in each Record.

    The only other alternative, if you, for example, do not know the sizes, is to load all the images up front and make sure they have all been loaded (and hence cached) before trying to display them in an auto-sizing context such as a ListGrid with autoFitData.

    Comment

    Working...
    X