Extjs5項目進行中(一)

來源:互聯網
上載者:User

標籤:style   blog   http   io   使用   java   strong   ar   檔案   

  以前沒有接觸過extjs,現在需要寫一個項目,計劃使用extjs來寫。畢竟頁面看起來比較清爽。自己看了2個星期的文檔和例子,還是雲裡霧裡。光java配置就弄了4-5天,最後不得已放棄。改為VS2013開發。

  第一個成功啟動並執行代碼,當然不是Hello Word

  本人是菜鳥,因此只考慮功能是否正常顯示。雖然是用extjs5,但是某些功能可能是用低版本的文法來實現的。因為英文太難了,API基本看不懂。吐槽的請繞行。

  Extjs5包裡面引用的檔案目錄:其中icons是從朋友的項目裡面複製過來的,ux是從build的子檔案夾裡面複製出來的。

  

  項目目錄:

  

  html 頁面代碼引用:    

    <link href="Extjs5/build/packages/ext-theme-classic/build/resources/ext-theme-classic-all.css" rel="stylesheet" />
    <script src="Extjs5/build/bootstrap.js"></script>
    <script src="Appliction.js"></script>

  Appliction.js 代碼:    

(function () {
      Ext.onReady(function () {
            //開啟懸浮提示功能
            Ext.QuickTips.init();
            //開啟動態載入
            Ext.Loader.setConfig({
                  enabled: true
            });
            //建立應用程式的執行個體
            Ext.application({
                  //設定命名空間
                  name: ‘Lz‘,
                  //指定配置選項,設定相應的路徑
                  appFolder: ‘Application‘,
                  //載入控制器
                  controllers: [‘Systemes.user1‘],

                  //自動載入和執行個體化Viewport檔案
                  autoCreateViewport: ‘Lz.view.Systemes.users1‘
            });
       });
})();

 

controller層user1.js代碼:

Ext.define(‘Lz.controller.Systemes.user1‘, {
      extend: ‘Ext.app.Controller‘,
      //將Viewport.js添加到控制器
      views: [‘Systemes.users1‘]
});

 

view層users1.js代碼

Ext.Loader.setConfig({
      enabled: true
});
Ext.Loader.setPath(‘Ext.ux‘, ‘/Extjs5/ux‘);
Ext.require([
      ‘Ext.ux.statusbar.StatusBar‘
]);

Ext.define(‘Lz.view.Systemes.users1‘,{
      extend: ‘Ext.panel.Panel‘,
      xtype: ‘LayoutDefault‘,
      layout: ‘border‘,
      items:
      [ {
      region: ‘north‘,
      xtype: ‘panel‘,
      height: 80,
      style: ‘text-align:center;margin:-1px;‘,
      html: ‘<div style="font-weight:bold;font-size:24px">上海利眾綜合管理系統</div>‘
}, {
      region: ‘west‘,
      width: 300,
      title:‘導覽列‘,
      split: true,
      collapsible: true
}, {
      region: ‘center‘,
      xtype: ‘tabpanel‘,
      id: ‘centerTabPanel‘,
      activeTab: 0,
      items: {
            title: ‘我的工作‘,
            icon:‘../../../Extjs5/icons/house.png‘,
            layout: ‘fit‘ //自動填滿頁面
      }
},
{
      region: ‘south‘,
      style: ‘margin:-2px‘,
      items: [{
            xtype: ‘statusbar‘,
            defaultIconCls: ‘default-icon‘,
            text: ‘Ready‘,
            iconCls: ‘Readyicon‘,
            items: [{}, ‘-‘, ‘綜合管理系統‘]
      }]
}]
});

 

最後:

 

如果有大神指教的,請加QQ:三陸玖貳玖伍三三肆

Extjs5項目進行中(一)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.