Ext.ns('ES');

//------------------------------------------------------------------------------
ES.TextField1 = Ext.extend(Ext.form.TextField,{
  maxLength: 49,
  allowBlank: true,
  maskRe: ES.regexAlphanum
  ,initComponent:function() {
    var config = {
      maxLengthText:'La Taille maximum du champ est de '+this.maxLength,
      minLengthText:'La Taille minimum du champ est de '+this.minLength
    };
     // apply config
    Ext.apply(this, Ext.apply(this.initialConfig, config));
    ES.TextField1.superclass.initComponent.apply(this, arguments);
  } // end of function initComponent
  ,onRender:function() {
    ES.TextField1.superclass.onRender.apply(this, arguments);
  } // eo function onRender

});

Ext.reg('TextField1', ES.TextField1);


//------------------------------------------------------------------------------
ES.TextFieldmail1 = Ext.extend(Ext.form.TextField,{
  maxLength: 40,
  allowBlank: true,
  vtype:'email',
  vtypeText: 'Votre adresse email doit être de la forme de "user@domain.com"',
  blankText:"Veuillez saisir votre adresse email."
  ,initComponent:function() {
    ES.TextFieldmail1.superclass.initComponent.apply(this, arguments);
  } // end of function initComponent
  ,onRender:function() {
    ES.TextFieldmail1.superclass.onRender.apply(this, arguments);
  } // eo function onRender

});

Ext.reg('TextFieldMail1', ES.TextFieldmail1);

//------------------------------------------------------------------------------
ES.NumberFieldZipCH = Ext.extend(Ext.form.NumberField,{
  allowBlank: true,
  minValue:999,
  maxValue:4000
  ,initComponent:function() {
    var config = {
      maxLengthText:'La Taille maximum du champ est de '+this.maxLength,
      minLengthText:'La Taille minimum du champ est de '+this.minLength,
      maxText:'La valeur du champ ne doit pas être supérieur à '+this.maxValue,
      minText:'La valeur du champ doit être supérieur à '+this.minValue
    };
     // apply config
    Ext.apply(this, Ext.apply(this.initialConfig, config));
    ES.NumberFieldZipCH.superclass.initComponent.apply(this, arguments);
  } // end of function initComponent
  ,onRender:function() {
    ES.NumberFieldZipCH.superclass.onRender.apply(this, arguments);
  } // eo function onRender

});

Ext.reg('NumberFieldZipCH', ES.NumberFieldZipCH);

//------------------------------------------------------------------------------
ES.ESNumber = Ext.extend(Ext.form.NumberField,{
  initComponent:function() {
    var config = {
      maxLengthText:'La Taille maximum du champ est de '+this.maxLength,
      minLengthText:'La Taille minimum du champ est de '+this.minLength,
      maxText:'La valeur du champ doit être inférieur à '+this.maxValue,
      minText:'La valeur du champ doit être supérieur à '+this.minValue
    };
     // apply config
    Ext.apply(this, Ext.apply(this.initialConfig, config));
    ES.ESNumber.superclass.initComponent.apply(this, arguments);
  } // end of function initComponent
  ,onRender:function() {
    ES.ESNumber.superclass.onRender.apply(this, arguments);
  } // eo function onRender

});

Ext.reg('ESNumber', ES.ESNumber);
//------------------------------------date--------------------------------------

ES.DateField = Ext.extend(Ext.form.DateField,{
  
  maxValue: 2010/12/31,
  minValue: 2000/12/01

  ,initComponent:function() {
    var config = {
//      minText:'Veuillez saisir une date supérieur a '+this.minValue,
//      maxText:'Veuillez saisir une date inférieur a '+this.maxValue
    };
    Ext.apply(this, Ext.apply(this.initialConfig, config));
    ES.DateField.superclass.initComponent.apply(this, arguments);
  } // end of function initComponent
  , onRender:function() {
    ES.DateField.superclass.onRender.apply(this, arguments);
  } // eo function onRender

});

Ext.reg('ESdatefield', ES.DateField);





