The source code
-
-
+
+
@@ -117,6 +117,10 @@ Ext.define('Ext.layout.component.field.Field', {
me.activeError = owner.getActiveError();
},
+
+ onFocus: function(){
+ this.getErrorStrategy().onFocus(this.owner);
+ },
/**
@@ -149,7 +153,7 @@ Ext.define('Ext.layout.component.field.Field', {
/**
* Return the set of strategy functions from the {@link #labelStrategies labelStrategies collection}
- * that is appropriate for the field's {@link Ext.form.field.Field#labelAlign labelAlign} config.
+ * that is appropriate for the field's {@link Ext.form.Labelable#labelAlign labelAlign} config.
*/
getLabelStrategy: function() {
var me = this,
@@ -160,7 +164,7 @@ Ext.define('Ext.layout.component.field.Field', {
/**
* Return the set of strategy functions from the {@link #errorStrategies errorStrategies collection}
- * that is appropriate for the field's {@link Ext.form.field.Field#msgTarget msgTarget} config.
+ * that is appropriate for the field's {@link Ext.form.Labelable#msgTarget msgTarget} config.
*/
getErrorStrategy: function() {
var me = this,
@@ -176,7 +180,7 @@ Ext.define('Ext.layout.component.field.Field', {
/**
* Collection of named strategies for laying out and adjusting labels to accommodate error messages.
- * An appropriate one will be chosen based on the owner field's {@link Ext.form.field.Field#labelAlign} config.
+ * An appropriate one will be chosen based on the owner field's {@link Ext.form.Labelable#labelAlign} config.
*/
labelStrategies: (function() {
var applyIf = Ext.applyIf,
@@ -256,7 +260,7 @@ Ext.define('Ext.layout.component.field.Field', {
/**
* Collection of named strategies for laying out and adjusting insets to accommodate error messages.
- * An appropriate one will be chosen based on the owner field's {@link Ext.form.field.Field#msgTarget} config.
+ * An appropriate one will be chosen based on the owner field's {@link Ext.form.Labelable#msgTarget} config.
*/
errorStrategies: (function() {
function setDisplayed(el, displayed) {
@@ -271,6 +275,18 @@ Ext.define('Ext.layout.component.field.Field', {
el.setStyle(name, value);
}
}
+
+ function showTip(owner) {
+ var tip = Ext.layout.component.field.Field.tip,
+ target;
+
+ if (tip && tip.isVisible()) {
+ target = tip.activeTarget;
+ if (target && target.el === owner.getActionEl().dom) {
+ tip.toFront(true);
+ }
+ }
+ }
var applyIf = Ext.applyIf,
emptyFn = Ext.emptyFn,
@@ -281,7 +297,8 @@ Ext.define('Ext.layout.component.field.Field', {
adjustHorizInsets: emptyFn,
adjustVertInsets: emptyFn,
layoutHoriz: emptyFn,
- layoutVert: emptyFn
+ layoutVert: emptyFn,
+ onFocus: emptyFn
};
return {
@@ -312,7 +329,8 @@ Ext.define('Ext.layout.component.field.Field', {
if (owner.hasActiveError()) {
setStyle(owner.errorEl, 'top', info.insets.top + 'px');
}
- }
+ },
+ onFocus: showTip
}, base),
/**
@@ -349,7 +367,8 @@ Ext.define('Ext.layout.component.field.Field', {
setDisplayed(owner.errorEl, false);
Ext.layout.component.field.Field.initTip();
owner.getActionEl().dom.setAttribute('data-errorqtip', owner.getActiveError() || '');
- }
+ },
+ onFocus: showTip
}, base),
/**