[Gmod-ajax] insert track in track container before anchor

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Gmod-ajax] insert track in track container before anchor

matthiasm
Hi everyone,

I am trying to use the insertNodes() function from the trackDndWidget (dojo.dnd.Source). This function should allow me with a boolean to place a track before (boolean set to true) or after (boolean set to false) the defined anchor node (i.e. in our case, a track). 
See dojo documentation for dojo.dnd.Source:

insertNodes
Returns self
inserts new data items (see dojo.dnd.Container.insertNodes() method for details)
ParameterTypeDescription
addSelectedBooleanall new nodes will be added to selected items, if true, no selection change otherwise
dataArraya list of data items, which should be processed by the creator function
beforeBooleaninsert before the anchor, if true, and after the anchor otherwise
anchorNodethe anchor node to be used as a point of insertion

Basically I am simulating a drag and drop event in order to add track(s) at a specific position in the track container. The showTracks dojo topic does not help in that case, since it adds tracks at the bottom.

Anyway, when I try to place a track after an anchor calling (1) trackDndWidget.insertNodes(false, trackConfigs, false, anchorTrackObject), it works well. The opposite (2) trackDndWidget.insertNodes(false, trackConfigs, true, anchorTrackObject) does not. 

I know it seems more to be a dojo bug, however I'd like to know if any of you tried successfully option (2). And if you have any idea why it should not work in the context of JBrowse, or about what I am doing wrong.

Best regards,

Matthias Monfort,
✉ 
[hidden email]
✍ European Molecular Biology Laboratory (EMBL),
 |  Furlong Group,
 |  Meyerhofstr. 1,
 |  Heidelberg, Germany.

PS: I posted a similar question while ago on this same mailing list, however this question is more specific, so I open a new post.


------------------------------------------------------------------------------

_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax
Reply | Threaded
Open this post in threaded view
|

Re: insert track in track container before anchor

Mts Mft
My Bad. I was doing something wrong. My anchorTrackObject was the object returned by _getTracks() when it should have been it's div. Everything works like a charm now!

Matthias
​.​


2015-10-28 11:35 GMT+01:00 Matthias Monfort <[hidden email]>:
Hi everyone,

I am trying to use the insertNodes() function from the trackDndWidget (dojo.dnd.Source). This function should allow me with a boolean to place a track before (boolean set to true) or after (boolean set to false) the defined anchor node (i.e. in our case, a track). 
See dojo documentation for dojo.dnd.Source:

insertNodes
Returns self
inserts new data items (see dojo.dnd.Container.insertNodes() method for details)
ParameterTypeDescription
addSelectedBooleanall new nodes will be added to selected items, if true, no selection change otherwise
dataArraya list of data items, which should be processed by the creator function
beforeBooleaninsert before the anchor, if true, and after the anchor otherwise
anchorNodethe anchor node to be used as a point of insertion

Basically I am simulating a drag and drop event in order to add track(s) at a specific position in the track container. The showTracks dojo topic does not help in that case, since it adds tracks at the bottom.

Anyway, when I try to place a track after an anchor calling (1) trackDndWidget.insertNodes(false, trackConfigs, false, anchorTrackObject), it works well. The opposite (2) trackDndWidget.insertNodes(false, trackConfigs, true, anchorTrackObject) does not. 

I know it seems more to be a dojo bug, however I'd like to know if any of you tried successfully option (2). And if you have any idea why it should not work in the context of JBrowse, or about what I am doing wrong.

Best regards,

Matthias Monfort,
✉ 
[hidden email]
✍ European Molecular Biology Laboratory (EMBL),
 |  Furlong Group,
 |  Meyerhofstr. 1,
 |  Heidelberg, Germany.

PS: I posted a similar question while ago on this same mailing list, however this question is more specific, so I open a new post.


------------------------------------------------------------------------------

_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax



------------------------------------------------------------------------------

_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax