Ext JS 网格面板:如何在鼠标悬停时显示内容

发布于 2024-11-23 19:17:17 字数 231 浏览 0 评论 0原文

我正在显示一个包含 2 列的 ext JS 网格面板。我必须保持两列的固定宽度。我的问题是,当文本显示在第一列中并且超过其宽度时,我没有任何方法可以看到整个文本(我可以手动拉伸它,但由于宽度固定,它有时不会显示)。也许有人知道我该怎么做-

我的意思是- 我可以在鼠标悬停时显示文本,但我希望它在用户将鼠标指针保持超过 5 秒时显示文本,否则会太烦人;如果用户将鼠标从第一行移动到最后一行。

任何其他想法也会有所帮助。

I am displaying a ext JS grid panel with 2 columns. I have to keep fixed width of both columns. My problem is that when a text is displayed in 1st column and when it exceeds its width, I don't have any way to see the entire text (I can manually stretch it but because of fixed width it doesn't show sometimes). May be anyone know How can I do it-

I mean -
I can show the text on mousehover but I want it to display text if user keeps mouse pointer more than 5 sec otherwise it will be too annoying; if user takes his mouse from 1st row to last.

Any other idea would also be helpful.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ゝ偶尔ゞ 2024-11-30 19:17:17

将以下样式添加到样式表中:

.wordwrap {
    white-space: pre-wrap; /* css-3 */
    white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
    white-space: -pre-wrap; /* Opera 4-6 */
    white-space: -o-pre-wrap; /* Opera 7 */
    word-wrap: break-word;
    white-space: normal; /* Internet Explorer 5.5+ */
}

然后将其包含在列的“cls”配置中:

columns: [{
    header: "Column 1",
    dataIndex: 'Col1',
    cls: 'wordwrap'
}]

这应该包含网格单元格的内容。

Add the following style to your stylesheet:

.wordwrap {
    white-space: pre-wrap; /* css-3 */
    white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
    white-space: -pre-wrap; /* Opera 4-6 */
    white-space: -o-pre-wrap; /* Opera 7 */
    word-wrap: break-word;
    white-space: normal; /* Internet Explorer 5.5+ */
}

and then include it in the 'cls' config of your column:

columns: [{
    header: "Column 1",
    dataIndex: 'Col1',
    cls: 'wordwrap'
}]

That should wrap your grid cell's contents.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文