代码之家  ›  专栏  ›  技术社区  ›  stackunderflow

ExtJS 3.4 GridPanel不显示在FormPanel内部

  •  0
  • stackunderflow  · 技术社区  · 12 年前

    我正在尝试修改示例代码以构建类似的表单 http://dev.sencha.com/deploy/ext-4.1.0-gpl/examples/form/form-grid.html

    我的代码如下:

        var references = new Ext.form.FormPanel({
        frame: true,
        title: 'References',
        bodyPadding: 5,
        layout: 'column',
        fieldDefaults: {
            labelAlign: 'left',
            msgTarget: 'side'
        },
        items: [{
            columnWidth: 0.60,
            xtype: 'gridpanel',
            store: reference_store,
            height: 400,
            title:'General',
            columns: [
              { id: 'name', header : 'Reference', flex: 1, sortable : true, dataIndex: 'reference' },
              { header: 'Impact', width : 75, sortable : true, dataIndex: 'impact'},
           ]
        }, {
            columnWidth: 0.4,
            margin: '0 0 0 10',
            xtype: 'fieldset',
            title:'Details',
            defaults: {
                width: 240,
                labelWidth: 90
            },
            defaultType: 'textfield',
            items: [{fieldLabel: 'Name', name: 'reference'}]
        }]
    });
    

    但整个FormPanel都没能显示出来。当我用“fieldset”或其他类型替换“gridpanel”时,无论格式如何,FormPanel都会出现。

    1 回复  |  直到 12 年前
        1
  •  2
  •   Erich Kitzmueller    12 年前

    xtype应该是grid而不是gridpanel