简体   繁体   English

Ext JS项目配置

[英]Ext JS items config

the generic Ext JS application created using the ext code generator tool, there are a lot of arrays named "items". 使用ext代码生成器工具创建的通用Ext JS应用程序,有很多名为“ items”的数组。 I can tell this is a configuration of some sort which can contain objects of key/value pairs but I cannot find any detailed documentation on this specifically. 我可以说这是某种配置,其中可以包含键/值对的对象,但是我找不到关于此的任何详细文档。 there are certain keys in the key/value pairs, such as xtype, reference, listeners, etc., is there an exhaustive list of such keys that can be used in a items array? 键/值对中有某些键,例如xtype,引用,侦听器等,是否可以在items数组中使用这些键的详尽列表? What is this thing called in Ext JS lingo, items config? 在Ext JS术语中,items config叫什么东西? I did find mention of the "items config" on the Layouts and Containers page of the 6.7.0 documentation, but unfortunately it was a broken link and just basically mentioned it but gave no details. 我确实在6.7.0文档的“布局和容器”页面上发现了“ items config”,但是不幸的是,它是一个断开的链接,基本上只是提到了它,但未提供任何细节。

example from the application: 应用程序中的示例:

items: [
    { xtype: 'navview',    reference: 'navview',    docked: 'left',   bind: {width:  '{navview_width}'}, listeners: { select: "onMenuViewSelectionChange"} },
    { xtype: 'headerview', reference: 'headerview', docked: 'top',    bind: {height: '{headerview_height}'} },
    { xtype: 'footerview', reference: 'footerview', docked: 'bottom', bind: {height: '{footerview_height}'} },
    { xtype: 'centerview', reference: 'centerview' },
    { xtype: 'detailview', reference: 'detailview', docked: 'right',  bind: {width:  '{detailview_width}'}  },
]

The items configuration is available for all ExtJS components that are descendants of the Ext.container.Container class. items配置可用于所有Ext.container.Container类的后代ExtJS组件。 As you can see from the items config description: 项目配置描述中可以看到:

A single item, or an array of child Components to be added to this container 单个项目或要添加到此容器的子组件数组

The main config from the items object is xtype . items对象的主要配置是xtype This is basically an alias of the component's class. 这基本上是组件类的别名。

This property provides a shorter alternative to creating objects than using a full class name. 与使用完整的类名相比,此属性为创建对象提供了更短的选择。 Using xtype is the most common way to define component instances, especially in a container. 使用xtype是定义组件实例的最常见方法,尤其是在容器中。

You can check Ext.enums.Widget for a full list of xtypes that ExtJS provides. 您可以检查Ext.enums.Widget以获取ExtJS提供的xtype的完整列表。 Alongside xtype you can have any other config properties available for the component that xtype determines. 除了xtype之外,您还可以具有其他任何用于xtype确定的组件的配置属性。

You can also usually define custom xtypes for your own component classes, and the use them in your items config. 通常,您还可以为自己的组件类定义自定义xtype,并在items配置中使用它们。 As there seems to be the case in the code you've provided. 您提供的代码中似乎存在这种情况。 Those are not predefined ExtJS xtypes. 这些不是预定义的ExtJS xtype。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM