大家好
现在学习ext开发网页
遇到日期控件不能多次选择的问题
就是第一次选择日期正常,但是再次去选择就弹不出日期窗口
并且ie右下角提示 脚本错误  
很是郁闷 不知道是什么原因
代码如下columnWidth: .5,
  layout: 'form',
  defaultType: 'textfield',
  items: [
  {
  xtype: "combo",
  fieldLabel: '城市',
  name: 'dep',
  hiddenName: 'seg1',//提交到后台的input的name
  triggerAction: 'all', // 显示所有下列数据,一定要设置属性triggerAction为all  
  editable: false, //是否可以编辑
  store: new Ext.data.SimpleStore({
  fields: ['value', 'text'],
  data: [
  ['上海', 上海'],
  ['广州', '广州'],
  ['深圳', '深圳']
  ]
  }),
  displayField: 'text',
  valueField: 'value',
  mode: 'local',
  emptyText: '-- 请选择 --'
  },
  {
  xtype: 'datefield',
  fieldLabel: '日期',
  format: 'Y-m-d',  
  name: 'date1'
  }
  ]代码如上
页面刚开始显示可以选择日期
但是若多点击几次后
日期控件就会出错请问这是什么原因  
谢谢

解决方案 »

  1.   


    把datefield重写试试
    Ext.override(Ext.form.DateField, {
    value : new Date(),
    format: 'Y-m-d',
    editable: false ,
    getValue : function(){
            return this.parseDate(Ext.form.DateField.superclass.getValue.call(this)) || null;
        },
        initComponent : function(){
            Ext.form.DateField.superclass.initComponent.call(this);
            if(typeof this.minValue == "string"){
                this.minValue = this.parseDate(this.minValue);
            }
            if(typeof this.maxValue == "string"){
                this.maxValue = this.parseDate(this.maxValue);
            }
            this.ddMatch = null;
            if(this.disabledDates){
                var dd = this.disabledDates;
                var re = "(?:";
                for(var i = 0; i < dd.length; i++){
                    re += dd[i];
                    if(i != dd.length-1) re += "|";
                }
                this.ddMatch = new RegExp(re + ")");
            }
        }
    })
      

  2.   

    可试试楼上的
    顺便问一下,你的是IE几?还是firefox?
      

  3.   


    我的 这个问题 在 ext 的例子中也存在我运行 ext 下面的  examples\form\xml-form.html第一次选择日期 就能成功若选日起后 在点击其他控件选择 然后 在点击 日期 就会提示错误请问 这个怎么解决 谢谢了