HI,
I have a ExtJS parent ‘container’ type, whereas i need to add a ‘contextmenu’ listener to any element that is added to this parent container, via Drag/Drop.
Can someone guide me as to the best way to do this?
I have tried this below but can’t get the function to fire.
myContainer.on('added', function(obj1,obj2,index){
alert('added');
});
this may not be the ‘best practice’ to do it this way anyway…?
thanks for the help !
You’re using the wrong event… The
addedevent gets fired when (using your example)myContaineris added to some other container. What you’ll need is theaddevent that fires, when an item is added tomyContainer: