使用mozilla firefox显示动态创建的extjs字段

时间:2013-09-11 10:08:06

标签: javascript extjs extjs4

我在使用mozilla firefox在extjs 4上显示动态创建的字段时遇到问题。它适用于chrome,但当我尝试在firefox上打开它时,它不再工作了。这是我的代码:

var strParam = record.data.ReportParameter.split(",");
for (var i = 0; i < strParam.length; i++) {
    if (strParam[i] != '') {
        if (strParam[i].indexOf('.') != -1) {
            var tbl = strParam[i].substring(0, strParam[i].indexOf('.'));
            var fdstr = Ext.String.trim(strParam[i].substring(strParam[i].indexOf('.') + 1));
            var fd, fdesc;
            if (fdstr.indexOf(':') != -1) {
                fd = fdstr.substring(0, fdstr.indexOf(':'));
                fdesc = fdstr.substring(fdstr.indexOf(':') + 1);
            } else {
                fd = fdstr;
                fdesc = fdstr;
            }
            var report_store_lookup = new Ext.data.Store({
                fields: ['id', 'desc'],
                proxy: {
                    type: 'ajax',
                    api: {
                        read: './reportlookupList'
                    },
                    reader: {
                        type: 'json',
                        root: 'data'
                    }
                },
                autoLoad: false
            });
            report_store_lookup.load({
                params: {
                    tablename: tbl,
                    fieldid: fd,
                    fielddesc: fdesc
                }
            });
            var tf = Ext.create('Ext.form.field.ComboBox', {
                name: fd,
                allowBlank: false,
                store: report_store_lookup,
                labelWidth: '60',
                queryMode: 'local',
                valueField: 'id',
                displayField: 'desc',
                fieldLabel: fd
            });
        } else {
            var tf = Ext.create('Ext.form.field.Text', {
                name: strParam[i],
                allowBlank: false,
                labelWidth: '60',
                fieldLabel: strParam[i]
            });
        }

        cntnr.add(tf);
    }
}

left side is firefox right side is chrome

0 个答案:

没有答案