2010-10-14 59 views
0

我想使用sencha.i創建一個面板,嘗試了下面的代碼,但它不起作用。如何使用sencha創建面板

Ext.setup({ 
    icon: 'icon.png', 
    tabletStartupScreen: 'tablet_startup.png', 
    phoneStartupScreen: 'phone_startup.png', 
    glossOnIcon: false, 
    onReady: function() { 


    var main = new Ext.Panel({ 
     title: 'My first panel', //panel's title 
     width:250, //panel's width 
     height:300, //panel's height 
     //the element where the panel is going to be inserted 
     html: 'Nothing important just dummy text' //panel's content 
    }); 
    main.render('frame'); 
    } 
    }); 

回答

0

我認爲你缺少面板的佈局,如果你設置「全屏」屬性爲true,那麼你應該看到你的面板出現。

在這裏有一個很好的視頻教程http://vimeo.com/15879797

希望有幫助,我現在剛剛學習Sencha!

Ext.setup({ 
      icon: 'icon.png', 
      tabletStartupScreen: 'tablet_startup.png', 
      phoneStartupScreen: 'phone_startup.png', 
      glossOnIcon: false, 
      onReady: function() { 


      var main = new Ext.Panel({ 
            title: 'My first panel', //panel's title 
            fullscreen: true, 
            //the element where the panel is going to be inserted 
            html: 'Nothing important just dummy text' //panel's content 
            }); 

      } 
      });