Drag and drop of a widget

2353
2
Jump to solution
04-10-2016 04:37 AM
LubomírBucek
New Contributor II

I would like to put an action on widget window drag and drop. Is it possible? Does moving a widget panel by a user emit some kind of event, which I would be then able to use somehow like this: on(this.something, 'move', Dosomething) ???

Thanks

Lubomír

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Lubomír,

  Sure. If you add the require for dojo/topic and these lines to the Widget.js then you can get the info on when the widgets is done moving:

topic.subscribe('/dnd/move/stop', lang.hitch(this, function(mover){
  console.info(mover.node);
}));

View solution in original post

2 Replies
RobertScheitlin__GISP
MVP Emeritus

Lubomír,

  Sure. If you add the require for dojo/topic and these lines to the Widget.js then you can get the info on when the widgets is done moving:

topic.subscribe('/dnd/move/stop', lang.hitch(this, function(mover){
  console.info(mover.node);
}));
LubomírBucek
New Contributor II

Thank you very much, this is exactly what I needed + I have never heard of dojo/topic.

Solved.

0 Kudos