Extjs Internet Explorer对象未找到问题

时间:2009-07-30 13:56:57

标签: internet-explorer extjs

这个代码运行firefox,但错误就是为什么?请帮帮我。

xxx.js代码:

var gridFormf = new Ext.FormPanel({
        id: 'company-form',
        frame: true,
        labelAlign: 'left',
        title: 'İş Emri',
        bodyStyle:'padding:5px',
        width: 1,
         tbar: [
            newIsEmri,delIsEmri,edIsEmri,rapIsEmri,serIsEmri
        ],
        layout: 'column',    // Specifies that the items will now be arranged in columns
        items: [
        {
            columnWidth: 0.3,
            layout: 'fit',
            items: [{
                    columnWidth: 1,
                    xtype: 'fieldset',
                    labelWidth: 90,
                    title:'Ekip / Servis',
                    defaults: {width: 120, border:false},    // Default config options for child items
                    defaultType: 'textfield',
                    autoHeight: true,
                    bodyStyle: Ext.isIE ? 'padding:0 0 5px 15px;' : 'padding:10px 15px;',
                    border: true,
                    style: {
                        "margin-left": "10px", // when you add custom margin in IE 6...
                        "margin-right": Ext.isIE6 ? (Ext.isStrict ? "-10px" : "-13px") : "0"  // you have to adjust for it somewhere else
                    },
                    items: [{
                        fieldLabel: 'Ekip / Personel',
                        name: 'SERVIS_VEREN'
                    }]
                },{
                    columnWidth: 1,
                    xtype: 'fieldset',
                    labelWidth: 90,
                    title:'Ürün',
                    defaults: {width: 120, border:false},    // Default config options for child items
                    defaultType: 'textfield',
                    autoHeight: true,
                    bodyStyle: Ext.isIE ? 'padding:0 0 5px 15px;' : 'padding:10px 15px;',
                    border: true,
                    style: {
                        "margin-left": "10px", // when you add custom margin in IE 6...
                        "margin-right": Ext.isIE6 ? (Ext.isStrict ? "-10px" : "-13px") : "0"  // you have to adjust for it somewhere else
                    },
                    items: [{
                        fieldLabel: 'Cihaz',
                        name: 'URUN_CIHAZ_ADI'
                    },
                    {
                        fieldLabel: 'Marka',
                        name: 'URUN_MARKA_ADI'
                    },
                    {
                        fieldLabel: 'Model',
                        name: 'URUN_MODEL_ADI'
                    },{
                        fieldLabel: 'Seri No',
                        name: 'URUN_SERI_NO'
                    }
                    ]
                }]
        },{
            columnWidth: 0.3,
            layout: 'fit',
            items: [{
                columnWidth: 1,
                xtype: 'fieldset',
                labelWidth: 90,
                title: 'Serviş Geliş Türü',
                defaults: {
                    width: 140,
                    border: false
                }, // Default config options for child items
                defaultType: 'textfield',
                autoHeight: true,
                bodyStyle: Ext.isIE ? 'padding:0 0 5px 15px;' : 'padding:10px 15px;',
                border: true,
                style: {
                    "margin-left": "10px", // when you add custom margin in IE 6...
                    "margin-right": Ext.isIE6 ? (Ext.isStrict ? "-10px" : "-13px") : "0" // you have to adjust for it somewhere else
                },
                items: [{
                    fieldLabel: 'Geliş Türü',
                    name: 'SERVIS_GELIS_TURU'
                }]
            },RadioPanels


            ]
        },{
            columnWidth: 0.3,
            layout: 'fit',
            items: [{
                columnWidth:1,
                autoHeight: true,
                border: true,

                items: [gridAksesuar]
            },gridAriza,{
                columnWidth: 1,
                xtype: 'textarea',
                labelWidth: 0,
                width:250,
                defaultType: 'textarea',
                autoHeight: true,
                border: false,
                name:'ARIZA_ACIKLAMASI'

            }]
        },{
            columnWidth: 1.0,
            layout: 'fit',
            items: gridFormx
        }]
    });

我的HTML代码:

<script src="/ApplicationJs/xxx.js" type="text/javascript"></script>
<script type="text/javascript">

Ext.onReady(function() {


    var viewport = new Ext.Viewport({
        layout:'fit',
        items: [gridFormf]
    });
</script>

Internet Explorer返回错误。错误描述是对象gridFormf未找到。

2 个答案:

答案 0 :(得分:2)

检查代码中的某个无关的逗号(,)。无论是在配置对象中,还是在您的JSON返回数据存储中。 FF将呈现,但IE将会中断。

首先通过JSLint运行JS代码,然后通过验证器运行JSON

答案 1 :(得分:1)

这可能是extJs的一个错误。 尝试使用sencha.com上的Sample ViewPort [RSS Feed]应用程序,您会发现Internet Explorer中的左侧折叠失败。