Ext.js 工具提示
描述
工具提示:当一些事件发生时,出现的小信息基本上是用于悬停事件。
句法
这里是创建工具提示的简单语法
T1 = new 'Ext.ToolTip'({properties});
例
下面是一个简单的例子显示工具提示
<!DOCTYPE html>
<html>
<head>
<link href="https://cdnjs.cloudflare.com/ajax/libs/extjs/6.0.0/classic/theme-classic/resources/theme-classic-all.css" rel="stylesheet" />
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/extjs/6.0.0/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中工具提示的使用方法,包括其基本句法、创建过程及如何通过事件触发显示。示例代码展示了如何创建一个带有标题、可关闭选项的工具提示,并将其绑定到按钮的悬停事件上。

被折叠的 条评论
为什么被折叠?



