Categories: Ext.js API

Ext.js:工具提示

返回到:Ext.js 教程:组件

工具提示:当一些事件发生时,出现的小信息基本上是用于悬停事件。

语法

这里是创建工具提示的简单语法:

T1 = new 'Ext.ToolTip'({properties});

下面是一个简单的例子显示工具提示

<!DOCTYPE html>
<html>
<head>
   <link href="./ext-6.0.0/build/classic/theme-classic/resources/theme-classic-all.css" rel="stylesheet">
   <script src="./ext-6.0.0/build/ext-all.js"></script>
   <script type="text/javascript">
      Ext.onReady(function() {
         toolTip = new Ext.ToolTip({       
            id : 'toolTip',
            anchor : 'bottom',
            html : 'This is a basic toolTip',
            title : 'Tool - Tip Title',
            closable : true,
            closeAction : 'hide'
         });
        Ext.create('Ext.Button', {
            renderTo: Ext.getElementById('buttonId'),
            text: 'Hover Me',
            listeners: {
               mouseover: function() {
                  toolTip.show();
               }
            }
         });
      });
   </script>
</head>
<body>
   <div id = "buttonId"></div>
</body>
</html>

运行截图如下所示:

返回到:Ext.js 教程:组件

terry

这个人很懒,什么都没有留下~

Share
Published by
terry

Recent Posts

在 Chrome 中删除、允许和管理 Cookie

您可以选择删除现有 Cooki…

15 小时 ago

自定义指令:聊聊vue中的自定义指令应用法则

今天我们来聊聊vue中的自定义…

1 周 ago

聊聊Vue中@click.stop和@click.prevent

一起来学下聊聊Vue中@cli…

2 周 ago

Nginx 基本操作:启动、停止、重启命令。

我们来学习Nginx基础操作:…

2 周 ago

Vue3:手动清理keep-alive组件缓存的方法

Vue3中手动清理keep-a…

3 周 ago

聊聊React和Vue组件更新的实现及区别

React 和 Vue 都是当…

4 周 ago