Ext.js 第一个程序

本章列出了在Ext JS中首先编写Hello World程序的步骤:

步骤1

在我们选择的编辑器中创建index.htm页面。 将所需的库文件包含在html页面的head部分,如下所述:

index.htm

<!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="/attachments/tuploads/extjs/ext-all.js"></script>
      <script type="text/javascript">
         Ext.onReady(function() {
         Ext.create('Ext.Panel', {
            renderTo: 'helloWorldPanel',
            height: 200,
            width: 600,
            title: 'Hello world',
            html: 'First Ext JS Hello World Program'
            });
         });
      </script>
   </head>
   <body>
      <div id="helloWorldPanel" />
   </body>
</html>

Explanation

Ext.Panel类有以下各种属性:

第2步

在标准浏览器中打开index.htm文件,您将在浏览器上获得以下输出。