Question

I'm trying to create drag-n-drop tree in javascriptmvc, i use $.Drag and $.Drop JQueryMX special events. I make a drag-n-drop controller, there's no problem if i put all events ( draginit, dragmove, dropinit,dropend, ...) , in my init method but i have a lot of events and i need to listen to drag-drop events like taht :

".draggable draginit":function(event,drag){
   // drag init treatements 
},
".droppable dropinit":function(event,drop,drag){
  // drop init treatements 
}

I can do that with natives events like (click, mouseover, ...)

".class click":function(event){
// 
}

Anyone had experience with this ?

Thanks,

Was it helpful?

Solution

You may need to add the events to your controller's static listensTo array.

$.Controller('TabPanel',{
  listensTo : ['draginit']
},{
  '.draggable draginit' : function(){
  }
});

If that doesn't work for some reason, you could add a custom processor for the events.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top