gwt - 是否可以在悬停时向 SmartGWT listGrid 单元格添加工具提示?

标签 gwt smartgwt

是否可以在悬停时向 SmartGWT listGrid 单元格添加工具提示?
如果可能的话怎么办?
我不能罚款任何将工具提示直接添加到悬停单元格的方法,
有人可以帮我吗?

最佳答案

ListGridField governmentField = new ListGridField("government", "Government", 120);
    governmentField.setShowHover(true);
    governmentField.setHoverCustomizer(new HoverCustomizer() {
        public String hoverHTML(Object value, ListGridRecord record, int rowNum, int colNum) {
            CountryRecord countryRecord = (CountryRecord) record;
            int governmentDesc = countryRecord.getGovernmentDesc();
            String[] governmentDescription = new String[]{
              "<b>Communism</b> - a system of government in which the state plans and controls the economy and a single - often authoritarian - party holds power; state controls are imposed with the elimination of private ownership of property or capital while claiming to make progress toward a higher social order in which all goods are equally shared by the people (i.e., a classless society).",
              "<b>Constitutional monarchy</b> - a system of government in which a monarch is guided by a constitution whereby his/her rights, duties, and responsibilities are spelled out in written law or by custom.",
              "<b>Federal republic</b> - a state in which the powers of the central government are restricted and in which the component parts (states, colonies, or provinces) retain a degree of self-government; ultimate sovereign power rests with the voters who chose their governmental representatives.",
              "<b>Federal (Federative)</b> - a form of government in which sovereign power is formally divided - usually by means of a constitution - between a central authority and a number of constituent regions (states, colonies, or provinces) so that each region retains some management of its internal affairs; differs from a confederacy in that the central government exerts influence directly upon both individuals as well as upon the regional units.",
              "<b>Parliamentary monarchy</b> - a state headed by a monarch who is not actively involved in policy formation or implementation (i.e., the exercise of sovereign powers by a monarch in a ceremonial capacity); true governmental leadership is carried out by a cabinet and its head - a prime minister, premier, or chancellor - who are drawn from a legislature (parliament).",
              "<b>Republic</b> - a representative democracy in which the people's elected deputies (representatives), not the people themselves, vote on legislation."
      };
            return governmentDescription[governmentDesc];
        }
    });

来自:http://www.java2s.com/Code/Java/GWT/TablecellhovertooltipSmartGWT.htm

关于gwt - 是否可以在悬停时向 SmartGWT listGrid 单元格添加工具提示?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18231778/

相关文章:

java - 在 Eclipse 中配置 GWT

javascript - 如何将 d3 GWT 包装器添加到 vaadin?

gwt - Google GWT 跨浏览器支持 : is it BS?

java - 在 SmartGWT 中创建具有小部件的表单

java - GWT 和 HTML 的集成

java - SmartGWT 中的多列网格过滤器

multithreading - 在构造函数中进行 GWT 异步回调是否安全?

java - GWT 2.1 : ResettableEventBus doesn't reset?

gwt - SmartGWT 中 ListGrid 中的 setData

smartgwt - 我在哪里可以找到 smart gwt 主题的文件以及如何在 smartgwt 中使用自定义主题