Create tooltip after setting show hover is true

2019-08-30 06:35发布

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.

enter image description here

标签: gwt smartgwt
1条回答
地球回转人心会变
2楼-- · 2019-08-30 07:21

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";
        }
    });
查看更多
登录 后发表回答