/*!
- * Ext JS Library 3.2.0
+ * Ext JS Library 3.2.1
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
value = value || this.processValue(this.getRawValue());
- if(Ext.isFunction(this.validator)){
+ if (Ext.isFunction(this.validator)) {
var msg = this.validator(value);
if (msg !== true) {
errors.push(msg);
}
}
+ if (value.length < 1 || value === this.emptyText) {
+ if (this.allowBlank) {
+ //if value is blank and allowBlank is true, there cannot be any additional errors
+ return errors;
+ } else {
+ errors.push(this.blankText);
+ }
+ }
+
if (!this.allowBlank && (value.length < 1 || value === this.emptyText)) { // if it's blank
errors.push(this.blankText);
}
initEvents : function(){
Ext.form.ComboBox.superclass.initEvents.call(this);
-
+ /**
+ * @property keyNav
+ * @type Ext.KeyNav
+ * <p>A {@link Ext.KeyNav KeyNav} object which handles navigation keys for this ComboBox. This performs actions
+ * based on keystrokes typed when the input field is focused.</p>
+ * <p><b>After the ComboBox has been rendered</b>, you may override existing navigation key functionality,
+ * or add your own based upon key names as specified in the {@link Ext.KeyNav KeyNav} class.</p>
+ * <p>The function is executed in the scope (<code>this</code> reference of the ComboBox. Example:</p><pre><code>
+myCombo.keyNav.esc = function(e) { // Override ESC handling function
+ this.collapse(); // Standard behaviour of Ext's ComboBox.
+ this.setValue(this.startValue); // We reset to starting value on ESC
+};
+myCombo.keyNav.tab = function() { // Override TAB handling function
+ this.onViewClick(false); // Select the currently highlighted row
+};
+</code></pre>
+ */
this.keyNav = new Ext.KeyNav(this.el, {
"up" : function(e){
this.inKeyMode = true;
if (f.dataIndex == id || f.id == id || f.getName() == id) {
field = f;
return false;
- } else if (f.isComposite) {
+ } else if (f.isComposite && f.rendered) {
return f.items.each(findMatchingField);
}
}
return this;
},
+ /**
+ * Removes all fields from the collection that have been destroyed.
+ */
+ cleanDestroyed : function() {
+ this.items.filterBy(function(o) { return !!o.isDestroyed; }).each(this.remove, this);
+ },
+
/**
* Iterates through the {@link Ext.form.Field Field}s which have been {@link #add add}ed to this BasicForm,
* checks them for an id attribute, and calls {@link Ext.form.Field#applyToMarkup} on the existing dom element with that id.
// If a Container, its already destroyed by the time it gets here. Remove any references to destroyed fields.
}else if (c.findBy){
Ext.each(c.findBy(this.isField), this.form.remove, this.form);
+ if (c.isDestroyed) {
+ this.form.cleanDestroyed();
+ }
}
}
},
});
Ext.reg('form', Ext.FormPanel);
-Ext.form.FormPanel = Ext.FormPanel;/**
+Ext.form.FormPanel = Ext.FormPanel;
+/**
* @class Ext.form.FieldSet
* @extends Ext.Panel
* Standard container used for grouping items within a {@link Ext.form.FormPanel form}.
Ext.form.HtmlEditor.superclass.setReadOnly.call(this, readOnly);
if(this.initialized){
- this.setDesignMode(!readOnly);
+ if(Ext.isIE){
+ this.getEditorBody().contentEditable = !readOnly;
+ }else{
+ this.setDesignMode(!readOnly);
+ }
var bd = this.getEditorBody();
if(bd){
bd.style.cursor = this.readOnly ? 'default' : 'text';
* @param {Boolean} sourceEdit (optional) True for source edit, false for standard
*/
toggleSourceEdit : function(sourceEditMode){
- var iframeHeight, elHeight;
- if(sourceEditMode === undefined){
+ var iframeHeight,
+ elHeight,
+ ls;
+
+ if (sourceEditMode === undefined) {
sourceEditMode = !this.sourceEditMode;
}
this.sourceEditMode = sourceEditMode === true;
var btn = this.tb.getComponent('sourceedit');
- if(btn.pressed !== this.sourceEditMode){
+ if (btn.pressed !== this.sourceEditMode) {
btn.toggle(this.sourceEditMode);
- if(!btn.xtbHidden){
+ if (!btn.xtbHidden) {
return;
}
}
- if(this.sourceEditMode){
+ if (this.sourceEditMode) {
// grab the height of the containing panel before we hide the iframe
ls = this.getSize();
this.el.dom.removeAttribute('tabIndex');
this.el.focus();
this.el.dom.style.height = iframeHeight + 'px';
- }else{
+ }
+ else {
elHeight = parseInt(this.el.dom.style.height, 10);
- if(this.initialized){
+ if (this.initialized) {
this.disableItems(this.readOnly);
}
this.pushValue();
},
// private used internally
- createLink : function(){
+ createLink : function() {
var url = prompt(this.createLinkText, this.defaultLinkValue);
if(url && url != 'http:/'+'/'){
this.relayCmd('createlink', url);
if(Ext.isGecko){
// Gecko hack, see: https://bugzilla.mozilla.org/show_bug.cgi?id=232791#c8
this.setDesignMode(false); //toggle off first
-
+ this.setDesignMode(true);
}
- this.setDesignMode(true);
this.fireEvent('push', this, v);
}
* @hide
*/
});
-Ext.reg('htmleditor', Ext.form.HtmlEditor);/**
+Ext.reg('htmleditor', Ext.form.HtmlEditor);
+/**
* @class Ext.form.TimeField
* @extends Ext.form.ComboBox
* Provides a time input field with a time dropdown and automatic time validation. Example usage:
};
Ext.form.SliderField.superclass.onRender.call(this, ct, position);
this.wrap = this.el.wrap({cls: 'x-form-field-wrap'});
+ this.resizeEl = this.positionEl = this.wrap;
this.slider.render(this.wrap);
},
timeMask: /[\d\s:amp]/i
});
* </code></pre>
- * Another example:
+ * Another example:
* <pre><code>
// custom Vtype for vtype:'IPAddress'
Ext.apply(Ext.form.VTypes, {
* The function used to validate email addresses. Note that this is a very basic validation -- complete
* validation per the email RFC specifications is very complex and beyond the scope of this class, although
* this function can be overridden if a more comprehensive validation scheme is desired. See the validation
- * section of the <a href="http://en.wikipedia.org/wiki/E-mail_address">Wikipedia article on email addresses</a>
+ * section of the <a href="http://en.wikipedia.org/wiki/E-mail_address">Wikipedia article on email addresses</a>
* for additional information. This implementation is intended to validate the following emails:<tt>
* 'barney@example.de', 'barney.rubble@example.com', 'barney-rubble@example.coop', 'barney+rubble@example.com'
* </tt>.
*/
'emailText' : 'This field should be an e-mail address in the format "user@example.com"',
/**
- * The keystroke filter mask to be applied on email input. See the {@link #email} method for
+ * The keystroke filter mask to be applied on email input. See the {@link #email} method for
* information about more complex email validation. Defaults to:
* <tt>/[a-z0-9_\.\-@]/i</tt>
* @type RegExp
*/
- 'emailMask' : /[a-z0-9_\.\-@]/i,
+ 'emailMask' : /[a-z0-9_\.\-@\+]/i,
/**
* The function used to validate URLs
* @type String
*/
'urlText' : 'This field should be a URL in the format "http:/'+'/www.example.com"',
-
+
/**
* The function used to validate alpha values
* @param {String} value The value
*/
'alphanumMask' : /[a-z0-9_]/i
};
-}();
\ No newline at end of file
+}();