PDA

View Full Version : Canīt suspend events



defcon1
1 Apr 2011, 7:05 AM
Hi,

I want to interrupt the upcoming of a tooltip depending on a state, but the only thing I am getting is a javascript-error: Fehler: this.anchorEl is undefined

What am I doing wrong or how can I stop following events?

Many thanks!
d1



<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>

<link rel="stylesheet" type="text/css" href="js/ext-3.3.2/resources/css/ext-all.css" />
<script type="text/javascript" src="js/ext-3.3.2/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="js/ext-3.3.2/ext-all-debug.js"></script>

<script type="text/javascript">
Ext.onReady(function(){

var state = false;

var tip = new Ext.ToolTip({
title: 'Tooltip',
autoHide: true,
closable: true,
anchorToTarget: true,
draggable:true,
width: 150,
html: 'Default',
listeners: {

beforerender: {

fn: function (tip) {

if (state == false) {

tip.suspendEvents();
return false;
}
},
scope: this
}
},
target: 'tip-target',
id: 'ttip'
});

Ext.QuickTips.init();
});

</script>

<div id = "tip-target">Target</div>

</head>

<body>

</body>
</html>

fay
1 Apr 2011, 7:49 AM
You've got the tip-target div within the head section rather than the body. It should be:



// ...
</script>
</head>

<body>
<div id = "tip-target">Target</div>
</body>
</html>

defcon1
4 Apr 2011, 12:21 AM
Thanks for your comment, but of course this doesnīt change a thing ..../:)

mankz
4 Apr 2011, 10:57 AM
Use beforeshow, not beforerender.

defcon1
4 Apr 2011, 11:52 PM
Makes no difference ...

mankz
5 Apr 2011, 12:10 AM
Looks like this could be a bug, post a new thread in the bugs section to let the Ext devs investigate it....