Ext.TabPanel中的items具体解释

本文详细解析了Ext.TabPanel中items属性的使用方法,包括默认组件类型、布局需求及注意事项,帮助开发者正确配置TabPanel子组件。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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'


转载于:https://www.cnblogs.com/mfmdaoyou/p/6875578.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值