yyogev
8 Aug 2009, 11:30 PM
Hi everyone,
I implemented drag-and-drop within a multi-grouping grid, where the rows represent issues in a bug tracking system. The user can drag using any point in a handle area which contains a drag handle icon (the 4-directional arrows cross), a 'work' link (set/reset 'work' keyword on issues), and a link to allow viewing of issue details in a separate page. see attached picture example. (the link is the issue ID)
http://extjs.com/forum/attachment.php?attachmentid=15514&stc=1&d=1249802574
The use case in question happens when a user starts to drag an issue using the link to the issue. The user aborts the drag, but does so by first dragging back to the original position (users often try to undo actions by bringing things to where they found them...). In doing so, the link receives the click event and the browser navigates to the issue.
I tried to cancel the navigation from the link on aborted drag, but whatever I tried the navigation still happened.
Here are the relevant code snippets:
// in header
var in_drag = 0;
// in issue renderer
var bug_link = "<A href='/bugs/show_bug.cgi?id=" + value + "' " +
// disable click from drag by link and drop in same position
"onClick='return in_drag == 1 ? false : true;' " +
">" + text +
"</A>";
// in drag handling code
var el = Ext.get(get_bug_drag_handle(bug_id));
var s = new Ext.dd.DragSource(el,
{ddGroup: "milestones_drag_group"});
s.source_id = bug_id;
s.onDragDrop = handle_bug_drop;
s.onDrag = function(e) {in_drag = 1;};
s.endDrag = function (e) {in_drag = 0;};
I also tried using the onMouseUp() method of DragDrop.
Any help will be appreciated.
I implemented drag-and-drop within a multi-grouping grid, where the rows represent issues in a bug tracking system. The user can drag using any point in a handle area which contains a drag handle icon (the 4-directional arrows cross), a 'work' link (set/reset 'work' keyword on issues), and a link to allow viewing of issue details in a separate page. see attached picture example. (the link is the issue ID)
http://extjs.com/forum/attachment.php?attachmentid=15514&stc=1&d=1249802574
The use case in question happens when a user starts to drag an issue using the link to the issue. The user aborts the drag, but does so by first dragging back to the original position (users often try to undo actions by bringing things to where they found them...). In doing so, the link receives the click event and the browser navigates to the issue.
I tried to cancel the navigation from the link on aborted drag, but whatever I tried the navigation still happened.
Here are the relevant code snippets:
// in header
var in_drag = 0;
// in issue renderer
var bug_link = "<A href='/bugs/show_bug.cgi?id=" + value + "' " +
// disable click from drag by link and drop in same position
"onClick='return in_drag == 1 ? false : true;' " +
">" + text +
"</A>";
// in drag handling code
var el = Ext.get(get_bug_drag_handle(bug_id));
var s = new Ext.dd.DragSource(el,
{ddGroup: "milestones_drag_group"});
s.source_id = bug_id;
s.onDragDrop = handle_bug_drop;
s.onDrag = function(e) {in_drag = 1;};
s.endDrag = function (e) {in_drag = 0;};
I also tried using the onMouseUp() method of DragDrop.
Any help will be appreciated.