12345678910111213141516171819202122232425262728293031323334 |
- Ext.define('erp.view.core.form.HMSTimeMinuteField', {
- extend : 'Ext.form.field.Text',
- alias : 'widget.hmstimeminutefield',
- initComponent : function() {
- this.callParent(arguments);
- this.addEvents({
- afterChangeValue : true
- });
- },
- height:22,
- onTriggerClick : function() {
- var me = this;
-
- if (this.minutePicker && !this.minutePicker.hidden) {
- this.minutePicker.hide();
- return;
- }
- this.createMinutePicker().show();
- },
- regex : /^(([01]?[0-9])|(2[0-3])):[0-5][0-9]:[0-5][0-9]$/,
- regexText : '时间格式不正确!',
- setValue : function(value) {
- if(value != null && value != ""){
- value=value.replace(new RegExp(/(:)/g),":");
- if (!this.regex.test(value)) {
- value=null;
- }
- }
- this.callParent(arguments);
- },
- hasValid : function() {
- return this.regex.test(this.value);
- }
- });
|