码迷,mamicode.com
首页 > 其他好文 > 详细

Ext.TabPanel中的items详解

时间:2014-05-16 01:54:07      阅读:213      评论:0      收藏:0      [点我收藏+]

标签:ext.tabpanel中的items详

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详解,布布扣,bubuko.com

Ext.TabPanel中的items详解

标签:ext.tabpanel中的items详

原文地址:http://blog.csdn.net/qq1623267754/article/details/25924299

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!