Announcement

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

    hover width on title of column on listgrid

    I am using the following
    SmartClient Version: v8.3p_2013-04-19/PowerEdition Deployment (built 2013-04-19)


    I have a listgrid with rows and columns. I have a hover/prompt on the title of the column and a different hover on each cell in the grid.

    I would like to set the width of the title. the listgrid.sethoverwidth changes the width on the cell, not the title.

    How do I set the width of the hover on the title?

    Evan

    #2
    code

    Here is the code for setting the prompt on the title and the cells. This listgridfield is added to the listgrid. If I change the property on the list grid (setpromptwidth) it changes the cell hover width. But does not change the title hover width.

    Evan

    Code:
    private ListGridField getFieldHarvey() {
    		// fields
    		ListGridField lgFieldHarvey = new ListGridField(strHarveyFieldName, "RVI");
    		lgFieldHarvey.setWidth(30);
    		// lgFieldHarvey.setPrompt("Relative Value Index");
    		// Ticket #152
    		lgFieldHarvey.setPrompt("The Relay Relative Value Index (RVI) offers the relative value of life sciences assets at a point in time or over specific time spans. RVI creates a historical benchmark, allowing the objective comparison of life sciences assets to each other. Learn more here (hyperlink 'here' with http://relaytm.com/relay-relative-value-index-rvi/).");
    		lgFieldHarvey.setCanFilter(false);
    
    
    		lgFieldHarvey.setType(ListGridFieldType.IMAGE);
    		lgFieldHarvey.setImageURLPrefix("../images/Harvey");
    		lgFieldHarvey.setImageURLSuffix(".png");
    		lgFieldHarvey.setAlign(Alignment.LEFT);
    
    		HoverCustomizer hoverField = new HoverCustomizer() {
    			@Override
    			public String hoverHTML(Object value, ListGridRecord record, int rowNum, int colNum) {
    				String str = record.getAttributeAsString("ravi");
    				if (str == null) return null;
    				return str;
    			}
    		};
    		lgFieldHarvey.setHoverCustomizer(hoverField);
    		lgFieldHarvey.setShowHover(true);
    
    		return lgFieldHarvey;
    	}

    Comment


      #3
      progress of sorts

      Hello,

      I am using the enterprise blue style that comes with smart gwt. I dug into this and found a style and added in a min-width on the hover, which made the width larger. So I guess I am set.

      However, :-)

      In the text of one of our hovers is a URL and was thinking folks could click on the link in the hover. However, not sure this is even possible as the hovers follow the mouse and such. Is this a legal idea?

      Thanks,
      Evan

      PS here is the CSS incase someone else wants this
      Code:
      .canvasHover,
      .gridHover,
      .formHover {
        background-color: #fdfdd3; 
        border: 1px solid gray;
        color: black;
        font-family: Arial, Verdana, sans-serif;
        font-size: 11px;
        min-width:200px;
      }

      Comment


        #4
        To explicitly set the width of the hover for a listGrid field header, you should be able to use ListGridField.setHeaderButtonProperties(...) and pass in a Canvas with the "hoverWidth" applied to it.
        This essentially customizes the header button for the field.

        On your second question, currently this is something which we don't really support, but it is something we may add support for in the future. We'll let you know if this gets added

        Regards
        Isomorphic Software

        Comment

        Working...
        X