2010-10-14 64 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 
            }); 

      } 
      });