Results 1 to 3 of 3

Thread: ToolTipConfig.setMaxWidth doesn't work

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha Premium Member
    Join Date
    Oct 2009
    Posts
    112

    Default ToolTipConfig.setMaxWidth doesn't work

    ToolTipConfig.setMaxWidth doesn't work.

    The doc says default is 300. But when I setBody to a very long text. It sizes up to the browser window width before it wraps.

    Explicitly setting it doesn't work either. The issue is seen on IE11 and Chrome.

  2. #2
    Touch Premium Member
    Join Date
    Mar 2008
    Location
    Morgan Hill, CA
    Posts
    138

    Default

    I see the same. Not working.

  3. #3
    Sencha Sr Product Manager
    Join Date
    Jan 2012
    Location
    Arlington, WA
    Posts
    1,165

    Default

    This is a defect. There is a workaround for the issue in the mean time.

    Code:
    import com.google.gwt.core.client.EntryPoint;
    import com.google.gwt.user.client.ui.HTML;
    import com.google.gwt.user.client.ui.RootPanel;
    import com.sencha.gxt.widget.core.client.container.CenterLayoutContainer;
    import com.sencha.gxt.widget.core.client.container.Viewport;
    import com.sencha.gxt.widget.core.client.tips.ToolTip;
    import com.sencha.gxt.widget.core.client.tips.ToolTipConfig;
    
    
    public class ToolTipMaxSizeTest implements EntryPoint {
    
    
      @Override
      public void onModuleLoad() {
        ToolTipConfig config = new ToolTipConfig();
        config.setTitle("This is for test");
        config.setBody(
            "The people came out of their houses and smelled the hot stinging air and covered their noses from it. And the children came out of the houses, but they did not run or shout as they would have done after a rain. Men stood by their fences and looked at the ruined corn, drying fast now, only a little green showing through the film of dust. The men were silent and they did not move often. And the women came out of the houses to stand beside their men - to feel whether this time the men would break. The women studied the men's faces secretly, for the corn could go, as long as something else remained. The children stood near by, drawing figures in the dust with bare toes, and the children sent exploring senses out to see whether men and women would break the children peeked at the faces of the men and women, and then drew careful lines in the dust with their toes. Horses came to the watering troughs and nuzzled the water to clear the surface dust. After a while the faces of the watching men lost their bemused perplexity and became hard and angry and resistant. Then the women knew that they were safe and that there was no break");
        config.setMinWidth(300);
        config.setMaxWidth(400);
        config.setCloseable(true);
    
    
        CenterLayoutContainer testContainer = new CenterLayoutContainer();
        testContainer.add(new HTML("ONLY FOR TEST"));
    
    
        ToolTip tip = new ToolTip(testContainer, config) {
          @Override
          public void setMaxWidth(int maxWidth) {
            super.setMaxWidth(maxWidth);
    
    
            getElement().getStyle().setProperty("maxWidth", maxWidth + "px");
          }
    
    
          @Override
          public void setMinWidth(int minWidth) {
            super.setMinWidth(minWidth);
    
    
            getElement().getStyle().setProperty("minWidth", minWidth + "px");
          }
        };
    
    
        Viewport viewport = new Viewport();
        viewport.setWidget(testContainer);
        RootPanel.get().add(viewport);
      }
    
    
    }

Similar Threads

  1. ToolTipConfig on grid rows
    By soma13 in forum Sencha GXT Q&A
    Replies: 1
    Last Post: 25 Feb 2015, 4:30 PM
  2. Replies: 2
    Last Post: 17 Apr 2012, 5:17 AM
  3. [FIXED] MessageBox setMaxWidth/setMinWidth
    By gslender in forum Ext GWT: Bugs (1.x)
    Replies: 2
    Last Post: 23 Jul 2009, 11:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •