成人无码视频,亚洲精品久久久久av无码,午夜精品久久久久久毛片,亚洲 中文字幕 日韩 无码

資訊專欄INFORMATION COLUMN

extjs4學(xué)習(xí)之配置

crossoverJie / 1307人閱讀

摘要:最近在學(xué)習(xí)發(fā)現(xiàn)一篇文章中有錯(cuò)誤,網(wǎng)上很多人都是直接復(fù)制粘貼那篇文章,結(jié)果每個(gè)人注釋中都是寫的正確的答案,我也是醉了,這些猿么復(fù)制粘貼代碼都不帶檢查的么,為啥都變得很浮躁了呢。

最近在學(xué)習(xí)extjs4發(fā)現(xiàn)一篇文章中有錯(cuò)誤,網(wǎng)上很多人都是直接復(fù)制粘貼那篇文章,結(jié)果每個(gè)人注釋中都是寫的正確的答案,我也是醉了,這些猿么復(fù)制粘貼代碼都不帶檢查的么,為啥都變得很浮躁了呢。

現(xiàn)提供可以調(diào)試的代碼:

html文件很簡(jiǎn)單,就引入ext資源和自定義的js文件就可以了。




    
    測(cè)試配置
    
    
    


 

js文件就是定義了2個(gè)類,一個(gè)window,一個(gè)bottomBar,其中window中包含bottomBar對(duì)象,具體代碼如下:

/**
 * Created by catcher on 2016-3-30.
 */
Ext.define("My.own.Window",{
    /** @readonly */
    isWindow:true,
    config:{
        title:"This title",
        bottomBar:{
            enable:false,
            height:10,
            resizable:false
        }
    },
    constructor:function(config){
        this.initConfig(config);
        return this;
    },
    applyTitle:function(title){
        if(!Ext.isString(title)||title.length==0){
            alert("Error: Title must be a valid non-empty string!");
        }else{
            return title;
        }
    },
    applyBottomBar:function(bottomBar){
        if(bottomBar && bottomBar.enable){
            if(!this.bottomBar){
                return Ext.create("My.own.WindowBottomBar",bottomBar);
            }else{
                this.bottomBar.setConfig(bottomBar);
            }
        }
    }
});
 
Ext.define("My.own.WindowBottomBar",{
    config:{
        enable:true,
        height:10,
        resizable:false
    },
    constructor:function(config){
        this.initConfig(config);
        return this;
    }
});
 
var myWindow = Ext.create("My.own.Window", {
    title: "Hello World",
    bottomBar: {
        enable: true,
        height: 60,
        resizable: true
    }
});
 
console.log(myWindow.getTitle()); // "Hello World"
myWindow.setTitle("Something New");
console.log(myWindow.getTitle()); // "Something New"
myWindow.setTitle(null); // alerts "Error: Title must be a valid non-empty string!"
console.log(myWindow.getBottomBar().getHeight());
myWindow.setBottomBar({enable:true,height:100}); // Bottom bar"s height is changed to 100
console.log(myWindow.getBottomBar().getHeight());

文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。

轉(zhuǎn)載請(qǐng)注明本文地址:http://m.hztianpu.com/yun/86747.html

相關(guān)文章

  • extjs4學(xué)習(xí)之配置

    摘要:最近在學(xué)習(xí)發(fā)現(xiàn)一篇文章中有錯(cuò)誤,網(wǎng)上很多人都是直接復(fù)制粘貼那篇文章,結(jié)果每個(gè)人注釋中都是寫的正確的答案,我也是醉了,這些猿么復(fù)制粘貼代碼都不帶檢查的么,為啥都變得很浮躁了呢。 最近在學(xué)習(xí)extjs4發(fā)現(xiàn)一篇文章中有錯(cuò)誤,網(wǎng)上很多人都是直接復(fù)制粘貼那篇文章,結(jié)果每個(gè)人注釋中都是寫的正確的答案,我也是醉了,這些猿么復(fù)制粘貼代碼都不帶檢查的么,為啥都變得很浮躁了呢。 現(xiàn)提供可以調(diào)試的代碼: ...

    antyiwei 評(píng)論0 收藏0
  • 【搶先領(lǐng)】《React 學(xué)習(xí)之道》我們翻譯了一本最簡(jiǎn)單,且最實(shí)用的 React 實(shí)戰(zhàn)教程……

    摘要:學(xué)習(xí)之道簡(jiǎn)體中文版通往實(shí)戰(zhàn)大師之旅掌握最簡(jiǎn)單,且最實(shí)用的教程。前言學(xué)習(xí)之道這本書使用路線圖中的精華部分用于傳授,并將其融入一個(gè)獨(dú)具吸引力的真實(shí)世界的具體代碼實(shí)現(xiàn)。完美展現(xiàn)了的優(yōu)雅。膜拜的學(xué)習(xí)之道是必讀的一本書。 《React 學(xué)習(xí)之道》The Road to learn React (簡(jiǎn)體中文版) 通往 React 實(shí)戰(zhàn)大師之旅:掌握 React 最簡(jiǎn)單,且最實(shí)用的教程。 showIm...

    oneasp 評(píng)論0 收藏0
  • laravel學(xué)習(xí)之nginx配置站點(diǎn)

    摘要:前言設(shè)置項(xiàng)目的域名站點(diǎn)的時(shí)候,需要對(duì)做一些對(duì)應(yīng)的重寫配置,用來(lái)做相關(guān)路由,否則會(huì)報(bào)。 前言 設(shè)置laravel項(xiàng)目的域名站點(diǎn)的時(shí)候,需要對(duì)nginx做一些對(duì)應(yīng)的重寫rewrite配置,用來(lái)做相關(guān)路由,否則會(huì)報(bào)404。 nginx.conf配置 server { listen 80; server_name xxx.com; #域名 root /data/www...

    frank_fun 評(píng)論0 收藏0
  • laravel學(xué)習(xí)之nginx配置站點(diǎn)

    摘要:前言設(shè)置項(xiàng)目的域名站點(diǎn)的時(shí)候,需要對(duì)做一些對(duì)應(yīng)的重寫配置,用來(lái)做相關(guān)路由,否則會(huì)報(bào)。 前言 設(shè)置laravel項(xiàng)目的域名站點(diǎn)的時(shí)候,需要對(duì)nginx做一些對(duì)應(yīng)的重寫rewrite配置,用來(lái)做相關(guān)路由,否則會(huì)報(bào)404。 nginx.conf配置 server { listen 80; server_name xxx.com; #域名 root /data/www...

    Jaden 評(píng)論0 收藏0

發(fā)表評(píng)論

0條評(píng)論

閱讀需要支付1元查看
<