日期:2014-05-16  浏览次数:20552 次

Ext FormPanel中的ComboBox为什么声明失效,全部变成了文本框
学习Ext,做了一个FormPanel,用如下的代码添加了两个ComboBox控件
JScript code

{
                name: "b_types",
                xtype: "combo",
                fieldLabel: "网点类型",
                hiddenName: "type",
                readOnly: true,
                mode: "local",
                displayField: "show",
                valueField: "value",
                triggerAction: "all",
                value: "0",
                store: new Ext.data.SimpleStore({
                    fields: ["show", "value"],
                    data: [["全功能型", "0"],["销售服务型", "1"],["交易型","2"]]
                })
            },{
                xtype: "datefield",
                name:"b_openningTime",
                fieldLabel: "开业时间",
                allowBlank:false,
                blankText: "开业时间不允许为空"
            },
            new Ext.form.ComboBox({
                name: "b_parents",
                xtype: "combo",
                fieldLabel: "上级网点",
                hiddenName: "parentBranch",
                readOnly: true,
                mode: "local",
                displayField: "show",
                valueField: "value",
                triggerAction: "all",
                value: "0",
                store: new Ext.data.SimpleStore({
                    fields: ["show", "value"],
                    data: [["x", "0"], ["xxx", "1"],["xxx", "2"]]
                })
            }),



但运行后发现,这两种方式的ComboxBox声明都无效,全部变成了文本框,这是为什么,代码有错吗?有没有做过Ext的啊,求解!!!

------解决方案--------------------
你把 readOnly 去掉就是了