Grid标题单元格的描述工具提示

Grid标题单元格的描述工具提示

本文介绍了Vaadin Grid标题单元格的描述工具提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想定义Grid标头单元格的描述,类似于 AbstractComponent.setDescription(字符串描述)的工作方式(即鼠标悬停时显示的工具提示)。由于Grid本身不支持这一点,我尝试在标题单元格中添加 Label 组件,然后使用 setDescription()在标签上。我可以让信息工具提示像这样工作,但缺点是单击标签组件不会触发排序。如果我想对列进行排序,我需要单击标签组件右边缘和列边框之间的非常狭窄区域上的标题单元格,其中将显示排序指示符。如果你看下面的截图,突出显示的区域是标签组件,为了触发排序,用户需要点击组件右侧的空间。

I'd like to define descriptions for Grid header cells, similarly to how AbstractComponent.setDescription(String description) works (i.e. tooltip shown on mouse hover). As the Grid doesn't support this in itself, I tried adding a Label component into the header cell, and then use setDescription() on the label. I can get the info tooltip working like this, but the downside is that clicking on the label component doesn't trigger sorting. If I want to sort the column, I need to click the header cell on the really narrow area that's left between the right edge of the label component and the column border, where the sorting indicator will be shown. If you look at the screenshot below, the highlighted area is the label component, and in order to trigger sorting, the user needs to click on the space on the right side of the component.

是否有更好的方法将描述应用于标题单元格而不是我描述的?如果没有,当标题单元格包含组件时,有没有办法使排序正常工作?

Is there a better way to apply descriptions to header cells than the one I described? And if not, is there a way to make the sorting work properly when the header cell contains a Component?

推荐答案

添加到的功能Vaadin 8.4.0



在Vaadin 8.4.0中添加到Grid的功能。

Feature added to Vaadin 8.4.0

Feature added to Grid in Vaadin 8.4.0.

票证:

发行说明:

这篇关于Vaadin Grid标题单元格的描述工具提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 20:29