/source/Plug-in/ext/adv-vtypes.js
http://prosporous.googlecode.com/ · JavaScript · 45 lines · 29 code · 4 blank · 12 comment · 12 complexity · fde2ca9168c033dc0455f759fceee4b1 MD5 · raw file
- /*
- * Ext JS Library 2.2
- * Copyright(c) 2006-2008, Ext JS, LLC.
- * licensing@extjs.com
- *
- * http://extjs.com/license
- */
-
- // Add the additional 'advanced' VTypes
- Ext.apply(Ext.form.VTypes, {
- daterange : function(val, field) {
- var date = field.parseDate(val);
-
- if(!date){
- return;
- }
- if (field.startDateField && (!this.dateRangeMax || (date.getTime() != this.dateRangeMax.getTime()))) {
- var start = Ext.getCmp(field.startDateField);
- start.setMaxValue(date);
- start.validate();
- this.dateRangeMax = date;
- }
- else if (field.endDateField && (!this.dateRangeMin || (date.getTime() != this.dateRangeMin.getTime()))) {
- var end = Ext.getCmp(field.endDateField);
- end.setMinValue(date);
- end.validate();
- this.dateRangeMin = date;
- }
- /*
- * Always return true since we're only using this vtype to set the
- * min/max allowed values (these are tested for after the vtype test)
- */
- return true;
- },
-
- password : function(val, field) {
- if (field.initialPassField) {
- var pwd = Ext.getCmp(field.initialPassField);
- return (val == pwd.getValue());
- }
- return true;
- },
-
- passwordText : '????????'
- });