设置show hover之后创建工具提示为true [英] Create tooltip after setting show hover is true

查看:194
本文介绍了设置show hover之后创建工具提示为true的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

setShowHover 设置为true后,如何创建工具提示?现在它是一个空白的工具提示。

  ListGridField exportField = new IconField(FIELD_EXPORT,REDO_ICON.jpg,EXPORT_CUSTOM_GROUP_HANDLER); 

exportField.setShowHover(true);

试过 exportField.setPrompt(tooltip message); ,但是当我将鼠标放在它上面时,这并没有给每个图标一个工具提示。

当我将鼠标悬停在蓝色指针按钮上时,此图片显示工具提示为空白,仅当我将鼠标悬停在顶部蓝色时,才会显示消息工具提示消息 - 指针按钮。我希望它为每个蓝色指针按钮显示一个工具提示。



exportField.setHoverCustomizer() / code>来显示一个自定义的提示信息。



试试这个

  ListGrid grid = new ListGrid(); 

grid.setCanHover(true);
grid.setShowHover(true);

...

exportField.setHoverCustomizer(new HoverCustomizer(){
$ b $ @Override
public String hoverHTML(Object value,ListGridRecord记录,int rowNum,int colNum){
//您可以自定义提示并可以从当前记录中获取值
返回工具提示信息;
}
} );


After setting setShowHover true, how do I create the tooltip? Right now it is a blank tooltip.

 ListGridField exportField = new IconField(FIELD_EXPORT, REDO_ICON.jpg, EXPORT_CUSTOM_GROUP_HANDLER);

exportField.setShowHover(true);

Tried exportField.setPrompt("a tooltip message");, but this did not give every single icon a tooltip when i mouse over it.

This a picture showing the tooltip is blank when i hover over the blue-pointer button, the message "a tooltip message" only appear when I hover over the very top blue-pointer button. I want it to show a tooltip for every blue-pointer button.

解决方案

Use exportField.setHoverCustomizer() to show a customized prompt message.

Try this one

    ListGrid grid = new ListGrid();

    grid.setCanHover(true);
    grid.setShowHover(true);

    ...

    exportField.setHoverCustomizer(new HoverCustomizer() {

        @Override
        public String hoverHTML(Object value, ListGridRecord record, int rowNum, int colNum) {
            // you can customize the prompt and can get the values from current record also
            return "a tooltip message";
        }
    });

这篇关于设置show hover之后创建工具提示为true的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆