DateToNumberField.js 585 B

1234567891011121314151617181920
  1. /**
  2. * 日期类型的转换为数字类型
  3. * @author
  4. */
  5. Ext.define('erp.view.core.form.DateToNumberField', {
  6. extend: 'Ext.form.field.Base',
  7. alias: 'widget.dateToNumberField',
  8. layout: 'column',
  9. hideTrigger:true,
  10. baseCls: 'x-field',//f
  11. initComponent : function(){
  12. /*this.value = this.value + '-' + $I18N.common.status[this.value];*/
  13. var re = /^[0-9]+.?[0-9]*$/;
  14. var val = this.value;
  15. if(val != null && val !='' && !re.test(val)){
  16. this.value=this.value.replace(new RegExp(/(-)/g),"");
  17. }
  18. this.callParent(arguments);
  19. }
  20. });