法官的博客 发表于 2012-12-22 21:23:12

学习Extjs4 (2-1) 简单窗口

<div id="cnblogs_post_body">Ext中的展现基本都需要窗口的支持,渲染点、技术点比较多,别担心,慢慢搞定她。这里先展示一个简单的窗口。
一、简单窗口
http://images.cnitblog.com/blog/360798/201212/18133335-376e66f1de2c43e88f7e1cf54a1690c5.png
<div class="cnblogs_code"> 1 Ext.require(["*"]); 2 3 Ext.onReady(function () { 4   var win1; 5   var btnA1 = Ext.get("btnA1"); 6   btnA1.on("click", function (e) { 7         if (!win1) { 8             win1 = Ext.create('widget.window', { 9               title: '窗口1',10               closable: true,11               closeAction: 'hide',12               width: 600,13               minWidth: 350,14               height: 350,15                 layout: {16                     type: 'border',17                     padding: 518                 },19                 items: [{20                     region: 'west',21                     title: '导航',22                     width: 200,23                     split: true,24                     collapsible: true,25                     floatable: false26                 }, {27                     region: 'center',28                     xtype: 'tabpanel',29                   items: [{30                         title: '选项卡1',31                         html: 'Hello 选项卡1'32                   }, {33                         title: '选项卡2',34                         html: 'Hello 第二张选项卡'35                   }, {36                         title: '选项卡3(可关闭的选项卡)',37                         html: '点击选项卡右上角的 X 可以关闭哦',38                         closable: true39                   }]40                 }]41             });42       }43         btnA1.dom.disabled = true;44         if (win1.isVisible()) {45             win1.hide(this, function () {46               btnA1.dom.disabled = false;47             });48         } else {49             win1.show(this, function () {50               btnA1.dom.disabled = false;51             });52       }53     });54 });
页: [1]
查看完整版本: 学习Extjs4 (2-1) 简单窗口