Ext.js 基本警報(bào)框

2022-05-20 11:58 更新

描述

這是最簡(jiǎn)單的警報(bào)框只是為了顯示一些事件的一些信息。

語(yǔ)法

這里是基本警報(bào)框的簡(jiǎn)單語(yǔ)法。

 Ext.Msg.alert('Title', 'Basic message box in ExtJS');

下面是一個(gè)簡(jiǎn)單的例子顯示用法。

<!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() {
         Ext.create('Ext.Button', {
            renderTo: Ext.getElementById('msgBox'),
            text: 'Click Me',
            listeners: {
               click: function() {
                  Ext.Msg.alert('Title', 'Basic message box in ExtJS');
               }
            }
         });
      });
   </script>
</head>
<body>
   <p> Click the button for alert box </p>
   <div id = "msgBox" ></div>
</body>
</html>

這將產(chǎn)生以下結(jié)果

Ext.js 基本警報(bào)框


以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)