Create tooltip after setting show hover is true

不问归期 提交于 2019-12-13 21:19:33

问题


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.


回答1:


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";
        }
    });


来源:https://stackoverflow.com/questions/22543335/create-tooltip-after-setting-show-hover-is-true

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!