【问题标题】:ExtJS 3.4 GridPanel doesn't show inside a FormPanelExtJS 3.4 GridPanel 不显示在 FormPanel 中
【发布时间】:2012-10-06 04:07:35
【问题描述】:

我正在尝试修改示例代码以构建类似的表单 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 未能显示。当我将 'gridpanel' 替换为 'fieldset' 或其他类型时,FormPanel 确实会出现,无论格式如何。

【问题讨论】:

    标签: javascript extjs formpanel


    【解决方案1】:

    xtype 应该是“grid”而不是“gridpanel”

    【讨论】:

    • 有效!它确实是连线的,因为它是示例代码中的“gridpanel”。 lz能解释一下吗?
    • 在 Ext3 中,类和 xtypes 之间的映射有点混乱,我猜他们在 Ext4 中解决了这个问题。
    • 谢谢,还有一个问题。 FormPanel 的布局是 'column' ,但我的两列垂直对齐。可能是什么问题?
    • FormPanel 的布局总是Form。改用普通面板,并在其中嵌套一个 FormPanel。
    猜你喜欢
    • 2011-06-21
    • 2016-04-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-01-23
    • 2014-08-29
    • 1970-01-01
    相关资源
    最近更新 更多