zoukankan      html  css  js  c++  java
  • ExtJS Alias, xtype and widget

    Description

    What is exactly the relationship between these three different concepts? I know that if you alias a class bywidget.name you can later use it by specifying xtype: 'name'. The same class can also be initialized byExt.widget('name'). But what about alias that do not start with 'widget'? Can they be lazily initialized? What if I want to directly specify the fully qualified class name to be lazily initialized instead of creating and using a xtype? Can that be done?

    Answer

    widget is not the only prefix option, there are many. Plugins use plugin, proxies use proxy, ... Take a look at the ExtJS source to see more.

    xtype is a way to specify the component type in a config object. This is interpreted by a container to create the component. As containers can only contain components (and not plugins, proxies, etc.) it doesn't make sense to use xtypes with those other alias types.

    However, the other alias types are used in other places. When you specify a proxy on a model or store it is the alias you are using in the type option. Similarly, readers, writers, plugins and grid features are often created using their alias. e.g. for a grid features you'd use the ftype.

    If you take a look at the source to Ext.widget() it may give you some insight into how it works:

    http://docs.sencha.com/ext-js/4-0/so...-method-widget

    I don't believe there is a way to use the class name instead.

    Reference

  • 相关阅读:
    JS连接数据库“实例”
    sql数据字典
    硬件防火墙的配置
    xxx
    rhs属性文件删除法
    思科pix防火墙配置实例大全
    SilverLight中的画刷小结
    数据库表间的连接总结
    导入Excel到Sql Server 2005 (转)
    关于Silverlight页面跳转的总结
  • 原文地址:https://www.cnblogs.com/yuxiaoqi/p/5143580.html
Copyright © 2011-2022 走看看