1. 程式人生 > >Ext.TabPanel中的items具體解釋

Ext.TabPanel中的items具體解釋

should ref hit ica tde 什麽 item tool multipl

Ext.TabPanel中的items:

(來自項目源代碼中的items條目代碼)

items:{
id:"opt1",
title:"默認頁面",
tabTip:"這是默認頁面,不能夠關閉",
html:"這是默認頁面哦!

"
},,,,

items裏面的這一組配置到底是創建什麽組件的配置項,在哪裏有說明呢?英文原版api給出了說明。

If an xtype is not explicitly specified, the defaultType for that Container is used.

這一句話的翻譯是。假設xtype沒有被明白的指出,Container的defaultType將被用作xtype的值;

Container的defaultType的默認值是panel。

也就是說TabPanel中的items的值假設沒有指定xtype,則默認的就是panel。


items : Object/Array

** IMPORTANT: be sure to specify a layout if needed ! **

A single item, or an array of child Components to be added to this container,for example:

// specifying a single item
items: {...},
layout: ‘fit‘,    // specify a layout!

// specifying multiple items
items: [{...}, {...}],
layout: ‘anchor‘, // specify a layout!

Each item may be:

  • any type of object based on Ext.Component
  • a fully instanciated object or
  • an object literal that:
    • has a specified xtype
    • the Ext.Component.xtype specified is associated with the Componentdesired and should be chosen from one of the available xtypes as listedin Ext.Component.
    • If an xtype is not explicitlyspecified, the defaultType for that Container is used.
    • will be "lazily instanciated", avoiding the overhead of constructing a fullyinstanciated Component object

Notes:

  • Ext uses lazy rendering. Child Components will only be renderedshould it become necessary. Items are automatically laid out when they are firstshown (no sizing is done while hidden), or in response to a doLayout call.
  • Do not specify contentEl/html with items.


Class Ext.Container:

defaultType : String

The default xtype of child Components to create in this Container whena child item is specified as a raw configuration object, rather than as an instantiated Component.

Defaults to ‘panel‘, except Ext.menu.Menu which defaults to ‘menuitem‘,and Ext.Toolbar and Ext.ButtonGroup which default to ‘button‘


Ext.TabPanel中的items具體解釋