【问题标题】:Is it possible to use an xtype inside an ExtJS template是否可以在 ExtJS 模板中使用 xtype
【发布时间】:2014-10-07 03:48:50
【问题描述】:

我想知道我是否可以在 ExtJS 中做这样的事情。我正在创建自己的按钮作为 xtype,并希望在我正在创建的表格行中使用它。

testTpl:  Ext.DomHelper.createTemplate(
    {
        tag: 'tbody',
        children: [
            {
                tag: 'tr',
                cls: 'test-row',
                children:[{
                    tag: 'td',
                    cls: 'test-table-cell test-class1',
                    html: '{value1}'
                    },
                    {
                       tag: 'td',
                       xtype:'myxtype'
                       cls: 'test-table-cell test-class2',
                       html: '{value2}'
                    }]
             }]
     });

【问题讨论】:

    标签: javascript extjs extjs4


    【解决方案1】:

    不可能将 ExtJS 组件放置在 extjs 模板中。尽管您可以做的是在模板中创建一个占位符,然后在渲染函数中将 ExtJS 组件渲染到该占位符中。

    以下是一些示例链接:

    ExtJS 4.2.1 - add textfield to an XTemplate

    Extjs component inside Ext.XTemplate on EXTJS 4

    【讨论】:

      猜你喜欢
      • 2013-06-26
      • 2017-04-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-10-25
      • 1970-01-01
      • 2014-10-21
      • 1970-01-01
      相关资源
      最近更新 更多