/*!
- * Ext JS Library 3.2.1
+ * Ext JS Library 3.2.2
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
getTrigger : function(index){
return this.triggers[index];
},
+
+ afterRender: function(){
+ Ext.form.TwinTriggerField.superclass.afterRender.call(this);
+ var triggers = this.triggers,
+ i = 0,
+ len = triggers.length;
+
+ for(; i < len; ++i){
+ if(this['hideTrigger' + (i + 1)]){
+ triggers[i].hide();
+ }
+
+ }
+ },
initTrigger : function(){
- var ts = this.trigger.select('.x-form-trigger', true);
- var triggerField = this;
+ var ts = this.trigger.select('.x-form-trigger', true),
+ triggerField = this;
+
ts.each(function(t, all, index){
var triggerIndex = 'Trigger'+(index+1);
t.hide = function(){
triggerField.el.setWidth(w-triggerField.trigger.getWidth());
this['hidden' + triggerIndex] = false;
};
-
- if(this['hide'+triggerIndex]){
- t.dom.style.display = 'none';
- this['hidden' + triggerIndex] = true;
- }
this.mon(t, 'click', this['on'+triggerIndex+'Click'], this, {preventDefault:true});
t.addClassOnOver('x-form-trigger-over');
t.addClassOnClick('x-form-trigger-click');
},
setValue : function(v){
+ v = this.fixPrecision(v);
v = Ext.isNumber(v) ? v : parseFloat(String(v).replace(this.decimalSeparator, "."));
v = isNaN(v) ? '' : String(v).replace(".", this.decimalSeparator);
return Ext.form.NumberField.superclass.setValue.call(this, v);
beforeBlur : function(){
var v = this.parseValue(this.getRawValue());
if(!Ext.isEmpty(v)){
- this.setValue(this.fixPrecision(v));
+ this.setValue(v);
}
}
});
} else {
// set time to 12 noon, then clear the time
var parsedDate = Date.parseDate(value + ' ' + this.initTime, format + ' ' + this.initTimeFormat);
-
+
if (parsedDate) return parsedDate.clearTime();
}
},
this.menu.picker.setMaxDate(this.maxValue);
}
},
-
+
/**
* Runs all of NumberFields validations and returns an array of any errors. Note that this first
* runs TextField's validations, so the returned array is an amalgamation of all field errors.
*/
getErrors: function(value) {
var errors = Ext.form.DateField.superclass.getErrors.apply(this, arguments);
-
+
value = this.formatDate(value || this.processValue(this.getRawValue()));
-
+
if (value.length < 1) { // if it's blank and textfield didn't flag it then it's valid
return errors;
}
-
+
var svalue = value;
value = this.parseDate(value);
if (!value) {
errors.push(String.format(this.invalidText, svalue, this.format));
return errors;
}
-
+
var time = value.getTime();
- if (this.minValue && time < this.minValue.getTime()) {
+ if (this.minValue && time < this.minValue.clearTime().getTime()) {
errors.push(String.format(this.minText, this.formatDate(this.minValue)));
}
-
- if (this.maxValue && time > this.maxValue.getTime()) {
+
+ if (this.maxValue && time > this.maxValue.clearTime().getTime()) {
errors.push(String.format(this.maxText, this.formatDate(this.maxValue)));
}
-
+
if (this.disabledDays) {
var day = value.getDay();
-
+
for(var i = 0; i < this.disabledDays.length; i++) {
if (day === this.disabledDays[i]) {
errors.push(this.disabledDaysText);
}
}
}
-
+
var fvalue = this.formatDate(value);
if (this.disabledDatesRE && this.disabledDatesRE.test(fvalue)) {
errors.push(String.format(this.disabledDatesText, fvalue));
}
-
+
return errors;
},
* @method autoSize
*/
});
-Ext.reg('datefield', Ext.form.DateField);/**
+Ext.reg('datefield', Ext.form.DateField);
+/**
* @class Ext.form.DisplayField
* @extends Ext.form.Field
* A display-only text field which is not validated and not submitted.
}
return zindex;
},
+
+ getZIndex : function(listParent){
+ listParent = listParent || Ext.getDom(this.getListParent() || Ext.getBody());
+ var zindex = parseInt(Ext.fly(listParent).getStyle('z-index'), 10);
+ if(!zindex){
+ zindex = this.getParentZIndex();
+ }
+ return (zindex || 12000) + 5;
+ },
// private
initList : function(){
if(!this.list){
var cls = 'x-combo-list',
- listParent = Ext.getDom(this.getListParent() || Ext.getBody()),
- zindex = parseInt(Ext.fly(listParent).getStyle('z-index'), 10);
-
- if (!zindex) {
- zindex = this.getParentZIndex();
- }
+ listParent = Ext.getDom(this.getListParent() || Ext.getBody());
this.list = new Ext.Layer({
parentEl: listParent,
shadow: this.shadow,
cls: [cls, this.listClass].join(' '),
constrain:false,
- zindex: (zindex || 12000) + 5
+ zindex: this.getZIndex(listParent)
});
var lw = this.listWidth || Math.max(this.wrap.getWidth(), this.minListWidth);
this.list.alignTo.apply(this.list, [this.el].concat(this.listAlign));
// zindex can change, re-check it and set it if necessary
- var listParent = Ext.getDom(this.getListParent() || Ext.getBody()),
- zindex = parseInt(Ext.fly(listParent).getStyle('z-index') ,10);
- if (!zindex){
- zindex = this.getParentZIndex();
- }
- if (zindex) {
- this.list.setZIndex(zindex + 5);
- }
+ this.list.setZIndex(this.getZIndex());
this.list.show();
if(Ext.isGecko2){
this.innerList.setOverflow('auto'); // necessary for FF 2.0/Mac
this.checked = this.el.dom.checked;
}
// Need to repaint for IE, otherwise positioning is broken
- if(Ext.isIE){
+ if (Ext.isIE && !Ext.isStrict) {
this.wrap.repaint();
}
this.resizeEl = this.positionEl = this.wrap;
* True to combine errors from the individual fields into a single error message at the CompositeField level (defaults to true)
*/
combineErrors: true,
+
+ /**
+ * @cfg {String} labelConnector The string to use when joining segments of the built label together (defaults to ', ')
+ */
+ labelConnector: ', ',
//inherit docs
//Builds the composite field label
* @return {String} The built label
*/
buildLabel: function(segments) {
- return segments.join(", ");
+ return Ext.clean(segments).join(this.labelConnector);
},
/**
*/
toggleSourceEdit : function(sourceEditMode){
var iframeHeight,
- elHeight,
- ls;
+ elHeight;
if (sourceEditMode === undefined) {
sourceEditMode = !this.sourceEditMode;
}
if (this.sourceEditMode) {
// grab the height of the containing panel before we hide the iframe
- ls = this.getSize();
+ this.previousSize = this.getSize();
iframeHeight = Ext.get(this.iframe).getHeight();
this.el.dom.setAttribute('tabIndex', -1);
this.deferFocus();
- this.setSize(ls);
+ this.setSize(this.previousSize);
+ delete this.previousSize;
this.iframe.style.height = elHeight + 'px';
}
this.fireEvent('editmodechange', this, this.sourceEditMode);