PDA

View Full Version : ExtJS with jquery adapter window.show error



farracha
12 May 2009, 3:06 AM
Hi,

I'm using Ext 3.0 and jquery 1.3.2 together and I have found a problem on window.show().

The error is "R[S == "toggle" ? L ? "show" : "hide" : S] is not a function" in the jquery.1.3.2-min.js file.

My Javascript files are declared in the following order:
1- jquery-1.3.2.min.js
2- ext-jquery-adapter.js
3- ext-all.cs
4- myjs.js

The code snippet:


if (_mapOverview.isVisible() == false) {
_mapOverview.setPosition(screen.width - 235, 60);
Ext.get("overviewDiv").setVisible(true);
_mapOverview.setAnimateTarget(Ext.get("hNavOverview"));
_mapOverview.show();
}
else {
_mapOverview.hide();
}


any help?

chalda
5 Aug 2009, 3:06 AM
Uff... I get the same error when I try to drag an object outside the target.
Any help?

Case example:



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Drag 'n' drop problem with jquery</title>

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

Ext.onReady(function() {
var tree = new Ext.tree.TreePanel({
root:{text:'root', id:'root', expanded:true, children:[
{text:'Child 1',data:'Child 1 additional data',children:[
{text:'Child 1 Subchild 1', data:'Some additional data of Child 1 Subchild 1', leaf:true},
{text:'Child 1 Subchild 2',data:'Some additional data of Child 1 Subchild 2',leaf:true}
]},
{text:'Child 2',leaf:true,data:'Last but not least. Data of Child 2'}
]},
loader:new Ext.tree.TreeLoader({preloadChildren:true}),
enableDrag:true,
ddGroup:'t2div',
region:'west',
title:'Tree',
layout:'fit',
width:200,
split:true,
collapsible:true,
autoScroll:true,
listeners:{
startdrag:function() {
var t = Ext.getCmp('target').body.child('div.drop-target');
if(t) {
t.applyStyles({'background-color':'#f0f0f0'});
}
},
enddrag:function() {
var t = Ext.getCmp('target').body.child('div.drop-target');
if(t) {
t.applyStyles({'background-color':'white'});
}
}
}
});

var target = new Ext.Panel({
region:'center',
layout:'fit',
id:'target',
bodyStyle:'font-size:13px',
title:'Drop Target',
html:'<div class="drop-target" '
+'style="border:1px silver solid;margin:20px;padding:8px;height:140px">'
+'If you dopn\'t drop node here you get an error!!!!</div>',
afterRender:function() {
Ext.Panel.prototype.afterRender.apply(this, arguments);
this.dropTarget = this.body.child('div.drop-target');
var dd = new Ext.dd.DropTarget(this.dropTarget, {
ddGroup:'t2div',
notifyDrop:function(dd, e, node) {
var msg = '<i>You have dropped node:</i><br><br><table style="font-size:13px">';
msg += '<tr><td>id:</td><td><b>' + node.node.id + '</b></td></tr>'
msg += '<tr><td>text:</td><td><b>' + node.node.text + '</b></td></tr>';
msg += '<tr><td>leaf:</td><td><b>' + node.node.leaf + '</b></td></tr>';
msg += '<tr><td>data:</td><td><b>' + node.node.attributes.data + '</b></td></tr>';
msg += '</table>'
Ext.getCmp('target').body.child('div.drop-target').update(msg)
return true;
}
});
}
});



var win = new Ext.Window({
title: 'Drag & drop problem with jquery',
id:'tree2divdrag',
border:false,
layout:'border',
width:600,
height:400,
renderTo:Ext.getBody(),
items:[tree, target]
});
win.show();

});

</script>


</head>
<body>
</body>
</html>
( example code from http://examples.extjs.eu (http://examples.extjs.eu/) )

Condor
5 Aug 2009, 3:37 AM
It's a known bug (not yet fixed).

You can find a patch here (http://extjs.com/forum/showthread.php?p=364787#post364787).

chalda
5 Aug 2009, 5:02 AM
Thanks!

Condor
5 Aug 2009, 5:05 AM
I like your avatar! I spent countless hours trying to stop purple tentacle from taking over the world...

chalda
5 Aug 2009, 5:21 AM
OT
Ahah :) :D
My next step will be to put my favorite shirt (with purple tentacle) in the avatar ;)