ExtJs中,FitLayout是一个基本布局类,它主要用包含一个单独的组件,此组件会占满包含它的整个容器。
fit实现了此类。
var p = new Ext.Panel({ title: 'Fit Layout', layout:'fit', items: { title: 'Inner Panel', html: '<p>This is the inner panel content</p>', border: false } });
当你指定layout: ‘fit’时,即表示此Panel使用了FitLayout布局。
简单的讲FitLayout是类,fit是此类的对象。(其他基本布局一般也一样)
Note:使用FitLayout布局的Panel一般只包含一个组件。如果此Panel包含多个组件,且使用了FitLayout布局,则只会显示第一个组件。