From 025e5a5be154ac52000fc42b92ea5141d58510fb Mon Sep 17 00:00:00 2001
From: Renaud Le Gac <renaud.legac@free.fr>
Date: Sun, 21 Nov 2010 23:14:12 +0000
Subject: [PATCH] Fix a bug displaying tooltip. Now it work in all cases,
 independently of the layout.

---
 static/plugin_dbui/lib/appform2.js | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/static/plugin_dbui/lib/appform2.js b/static/plugin_dbui/lib/appform2.js
index e97fcc6d..35e101cc 100644
--- a/static/plugin_dbui/lib/appform2.js
+++ b/static/plugin_dbui/lib/appform2.js
@@ -55,15 +55,17 @@ App.form.EntryFormPanel = Ext.extend(App.form.FormPanel, {
 		
 		// Add handler to display tool tip for each field
 		// Require the configuration parameter tipText.
-		for (var i = 0; i < this.items.items.length; i++){
-			var field = this.items.items[i]; 
+		var fields = this.findByType('field');
+		for (var i = 0; i < fields.length; i++){
+			var field = fields[i];
 			if (field.tipText){
 				field.on('render', function(c){
 				    new Ext.ToolTip({
 				        target: c.getEl(),
+						title: c.fieldLabel,
 				        anchor: 'left',
 				        trackMouse: false,
-				        html: field.tipText
+				        html: Ext.util.Format.htmlEncode(c.tipText),
 				    });
 				});
 			}
-- 
GitLab