PDA

View Full Version : Drag and Drop Issue in Chrome only.



jignesh.vaja
3 Sep 2012, 1:56 AM
Hi,

I am using drag and drop functionality with tree. but i am getting error in chrome only.

error : Uncaught TypeError : Cannot call method 'afterload' of null
error : Uncaught TypeError : Cannot read property 'animate' of null.

This error comes only in chrome its working fine with ff,ie and other browsers.

i am using code below

Ext.extend(ImageDragZone, Ext.dd.DragZone, {
// We don't want to register our image elements, so let's
// override the default registry lookup to fetch the image
// from the event instead
getDragData : function(e){
var target = e.getTarget('.thumb-wrap');

if(target){
var view = this.view;
if(!view.isSelected(target)){
view.onClick(e);
}
var selNodes = view.getSelectedNodes();
var dragData = {
nodes: selNodes
};
if(selNodes.length == 1){
dragData.ddel = target;
dragData.single = false;
}
else{
var div = document.createElement('div'); // create the multi element drag "ghost"
div.className = 'multi-proxy';
for(var i = 0, len = selNodes.length; i < len; i++){
div.appendChild(selNodes[i].firstChild.firstChild.cloneNode(true)); // image nodes only
if((i+1) % 3 == 0){
div.appendChild(document.createElement('br'));
}
}
var count = document.createElement('div'); // selected image count
count.innerHTML = i + ' images selected';
div.appendChild(count);

dragData.ddel = div;
dragData.multi = false; // for dragging multiple data i.e. both file and folder can be dragged
//alert("hi");

//edited by ashish narola - disabled - mutli drag functionlity - date : -05-07-2012
return;
}
return dragData;
}
return false;
},

...................................
.................................

mitchellsimoens
19 Sep 2012, 11:31 AM
With a simple test case I created I cannot reproduce any error on Chrome. Is there a way you could create a simple test case I can run locally?