Announcement

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

    No tooltips in edit mode in ListGrid

    Hello,

    I should show a tooltip (or a hint) in listgrid cells, when user enters an edit mode. The tooltip/hint should explain what values can be entered in cell.
    The problem I see that in Edit mode all the tooltips disappear. How can I fix it?

    I use smartGWT 2.1, Internet Explorer 8.0

    Here is my code with definition of tooltip:
    Code:
            ListGrid countryGrid = new ListGrid();
            countryGrid.setCanEdit(true);
            countryGrid.setEditEvent(ListGridEditEvent.CLICK);
    
            countryGrid.setShowHover(true);
            countryGrid.setCanHover(true);
    
            ListGridField valueField = new ListGridField("value", "value column");
            valueField.setRequired(true);
            valueField.setShowHover(true);
            valueField.setHoverCustomizer(new HoverCustomizer() {
                public String hoverHTML(Object value, ListGridRecord record, int rowNum, int colNum) {
                    return "my tooltip";
                }
            });
    
            ListGridField nameField = new ListGridField("name", "name");
            nameField.setCanEdit(false);
    
            countryGrid.setFields(nameField, valueField);
    thank you

    #2
    Use the FormItem hover APIs via setEditorType().

    Comment


      #3
      I tried to do as you said. The prompt isn't shown as tooltip. Instead, it appears in a browser status bar. This behavior is unwanted in my case.

      Here is the basic test case:
      Code:
              ListGrid grid = new ListGrid();
              grid.setCanEdit(true);
              grid.setEditEvent(ListGridEditEvent.CLICK);
              grid.setEditByCell(false);//on row click it becomes editable
      
              grid.setShowHover(true);
              grid.setCanHover(true);
      
              //create a name field
              ListGridField nameField = new ListGridField("name","Name");
              
              TextItem textItem = new TextItem();
              textItem.setPrompt("test text item prompt");
              nameField.setEditorType(textItem);
              nameField.setCanEdit(true);
      
              ListGridField descriptionField = new ListGridField("description", "Description");
              descriptionField.setCanEdit(false);
      
              grid.setFields(nameField, descriptionField);
      I tried to set hoverDelay, hoverHeight, hoverWidth, itemHoverFormatter and other hover-related properties - with no effect.

      thank you

      Comment


        #4
        Hello Isomorphic,

        Do you have ideas of a workaround for this bug?


        thanks

        Comment


          #5
          I noticed that if I add a formIcon, a tooltip starts to show after formicon gets onmouseover event. But sometimes it doesn't work.
          Maybe someone knows how to fix this problem? Any support here?

          Code:
          TextItem formItem = new TextItem();
                  formItem.setItemHoverFormatter(new FormItemHoverFormatter() {
                      @Override
                      public String getHoverHTML(FormItem item, DynamicForm form) {
                          return "html hover";
                      }
                  });
          
                  FormItemIcon icon = new FormItemIcon();
                  icon.setSrc("[SKIN]/actions/help.png"); 
                  icon.setWidth(16);
                  icon.setHeight(16);
                  icon.setPrompt("icon prompt");
          
                  formItem.setIcons(icon);

          Comment

          Working...
          X