Announcement

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

    ListGrid cell drawn outside of window

    SmartClient Version: v10.0p_2015-06-23/Pro Deployment (built 2015-06-23)

    I have a modal window with a button at the bottom that, when pushed, shows a listgrid and starts editing a new row.

    The problem is that when the listgrid is shown, the layout scrolls to the top (I believe this is caused by the redraw when the layout is re-sized by the listgrid appearing) and the focused cell in the listgrid is shown outside of the modal window (see attached screenshot)

    Test case:
    Code:
    Window modal = new Window();
    modal.setHeight(300);
    modal.setWidth(300);
    modal.setIsModal(true);
    modal.setShowModalMask(true);
    modal.centerInPage();
    
    final VLayout vLayout = new VLayout();
    vLayout.setWidth100();
    vLayout.setOverflow(Overflow.AUTO);
    vLayout.setMinMemberSize(250);
    
    LayoutSpacer spacer = new LayoutSpacer();
    spacer.setHeight(200);
    
    DataSourceTextField dsField = new DataSourceTextField("text");
    dsField.setType(FieldType.TEXT);
    dsField.setLength(1000);
    
    DataSource ds = new DataSource("ds");
    ds.setClientOnly(true);
    ds.setFields(dsField);
    
    ListGridField field = new ListGridField("text");
    
    
    final ListGrid listGrid = new ListGrid();
    listGrid.setWidth100();
    listGrid.setDataSource(ds);
    listGrid.setFields(field);
    listGrid.hide();
    
    Button b = new Button("Press Me");
    b.addClickHandler(new ClickHandler() {
    	
    	@Override
    	public void onClick(ClickEvent event) {
    		if(!listGrid.isVisible())
    		{
    			listGrid.addDrawHandler(new DrawHandler() {
    				
    				@Override
    				public void onDraw(DrawEvent event) {
    					vLayout.scrollToBottom();
    					listGrid.startEditingNew();
    				}
    			});
    			listGrid.show();
    		}
    		else
    			listGrid.startEditingNew();
    	}
    });
    
    vLayout.setMembers(spacer, b, listGrid);
    modal.addItem(vLayout);
    modal.draw();
    I have tried adding vLayout.scrollToBottom() in the listgrid drawhandler but it doesn't do anything.

    Is there a way I can get the layout to scroll down to the listgrid when I start editing a new row?
    Attached Files

    #2
    Please try this with a stock skin, we think your custom skin is at fault because with the DOM structures SmartGWT creates by default, it should not possible for what you see to be drawn.

    Comment


      #3
      I see the same behavior with the Enterprise skin.
      Attached Files

      Comment


        #4
        We're not seeing this. We do see a Firefox-only issue (see attached) where the pop-up is misplaced, and we'll check that out.

        But as far as the overall problem you're experiencing, which isn't reproducible:

        1. you might have some CSS in the page *aside from* your custom skin influencing the behavior

        2. you might have some other JavaScript library or some kind of framework hack you tried to add, causing this issue. In particular, check for JavaScript errors in the Developer Console.
        Attached Files

        Comment


          #5
          As far as this Firefox-only issue - we're actually only seeing that on just one machine that shows anomalous behavior on many other tests too (we're not sure what's wrong with it).

          So at the moment, we don't seem to have anything to fix, and you should investigate the possibilities we previously mentioned.

          Comment

          Working...
          X