簡體   English   中英

是否可以在ExtJS模板中使用xtype

[英]Is it possible to use an xtype inside an ExtJS template

我想知道是否可以在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}'
                    }]
             }]
     });

無法將ExtJS組件放置在extjs模板中。 盡管您可以做的是在模板中創建一個占位符,然后將ExtJS組件渲染到render函數中的該占位符中。

以下是一些示例鏈接:

ExtJS 4.2.1-將文本字段添加到XTemplate

EXTJS 4上Ext.XTemplate內的Extjs組件

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM