ExtJS 4.2:工具提示不够宽,无法看到内容 [英] ExtJS 4.2: ToolTips not wide enough to see contents

查看:8
本文介绍了ExtJS 4.2:工具提示不够宽,无法看到内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自从升级到 ExtJS 4.2 后,我注意到当文本字段出现错误时显示的工具提示宽度不足以查看工具提示的内容 - 它们似乎总是 40 像素宽.

I've noticed since upgrading to ExtJS 4.2 that tooltips displayed when a textfield has an error in it are not wide enough to see the contents of the tooltip - they always seem to be 40px wide.

这是一个显示问题的测试用例:

Here's a test case which shows the problem:

<html>
<head>
    <title>Field error tooltips</title>
    <link rel="stylesheet" type="text/css" href="ext-4.2.0/resources/css/ext-all.css">
    <script type="text/javascript" src="ext-4.2.0/ext-all-debug.js"></script>
</head>
<body>
    <script type="text/javascript">
    Ext.onReady(function(){

        var form = Ext.create("Ext.form.Panel",{
            title: 'My form',
            width: 300,
            height: 100,
            items: [
                {xtype: 'textfield', name: 'FIELD1', fieldLabel: 'Field 1', allowBlank: false}
            ],
            renderTo: Ext.getBody()
        });
    });
    </script>
</body>
</html>

在上面的示例中,如果您单击该字段,然后在不输入任何内容的情况下单击它,它会显示一个工具提示,指出它不允许为空白.不幸的是,工具提示不够宽,无法看到消息.有没有其他人遇到过这种情况?

In the above example if you click the field and then click out of it without typing anything, it shows a tooltip saying that it's not allowed to be blank. The tooltip is not wide enough to see the message unfortunately. Has anyone else come across this?

谢谢!

推荐答案

感谢大家的帮助,但我在 sencha 论坛上找到了一个似乎有效的解决方案:

Thanks for the help guys, but I found a solution on the sencha forum which seems to work:

http://www.sencha.com/forum/showthread.php?260106-Tooltips-on-forms-and-grid-are-not-resizing-to-the-size-of-the-text/page3#24

具体是app开头的如下代码:

Specifically the following code at the beginning of the app:

delete Ext.tip.Tip.prototype.minWidth;

这篇关于ExtJS 4.2:工具提示不够宽,无法看到内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆