Hello all,
I would like to drag a row from Lister into another component and run a drop script.
How is this achieved? I can drop the whole node in and it works, but not when I click and drag a row.
Thanks,
Tim
Hello all,
I would like to drag a row from Lister into another component and run a drop script.
How is this achieved? I can drop the whole node in and it works, but not when I click and drag a row.
Thanks,
Tim
Made some examples. Not sure how familiar you are with setting up listerā¦ if you need more details just ask.
listerDrops.1.toe (10.3 KB)
Thank you Ivan!
This is exactly what Iām looking for.
-Tim
@Ivan is there a best practice way in 2021 to do dragdrop callbacks from lister beyond drop Surrogate? I want to be able to do things like dragging onto parameters and making dynamic references, and Iām wondering if any of the flexibility of the new system is implemented in recent Lister
Alas, listCOMP has not been brought up to the modern drag/drop system standards. Itās in the plan for upcoming releases, though.
any idea if this is a this year kind of thing? Trying to to weigh how heavily I should invest in a workaround
Yes, this is planned for the next release
In 38110 is dragging from the lister to a parameter field supported? I would very much like to return a path to an operator at info[ārowObjectā][āpathā] when dragging a row from lister to a par field. Some docs or an example on achieving this would be greatly appreciated
Hereās how you get the listerās row data object in the drag/drop callbacks for the lister:
cell = info[ālistCellā]
rowData = comp.Data[cell.row]
You can then do
return rowData[ārowObjectā][āpathā]
Iām gonna put this in the wiki right now. Cheers!
I still seem to be missing something hereā¦ I can get the drag to work when dragging from an unpopulated part of the lister, but with columns set to draggable and your script example, Iām still not getting anything from the onDragStartGetItems callback when dragging from a cell.
first of all, the Do Not Allow Drop option no longer exists, so my best bet is option is use parent drag/drop?
I can force something to happen with an onMouseDrag callback that mods the dragdrop script, but that doesnāt initiate whatever youāve got going on under the hood that instigates a viable drop location, so that isnāt doing the trick.
The other issue is that if it needs a returned True from onDropHover on the other end, it means i canāt drag into a network or parameter, which is the main functionality Iām looking for. Iād like to be able to drag a row or cell from lister, return that rowās āpathā column value, and drop it into a parameter elsewhere in my network to create a reference. Is there a way to test if the drop target is a parameter and return a path, or network editor pane to copy the referenced path op?
Is there any update on this?
Iām trying to drag and drop from one lister to another within a single window. Following the example by @Ivan this does work but not within the same network. It also does not work with floating windows. Iām trying to create a user interface in a single window with two listers where i can drag and drop from one to another. Is there a work around?
Weāve worked on this some. Can you post your network, or a simplified version with instructions for testing. Iāll either get it to work or get the bug fixed!
I think I solved my issue by modifying userExpectations.txt in my local directory
Was so long ago, I canāt even remember what I was hoping to accomplish, but I think it involved dragging items from lister to the network editor, or from outside of TD into lister, neither of which returned the callbacks I was hoping for at the time. Has that changed in the last year?
Nope, it hasnāt
Ah, yes. This problem was discovered in this thread: How to use drag and drop system in Lister Comp - #9 by Ivan
It will be fixed in the next release, and thereās a workaround at the end of the thread.
Thank you Ivan!
Quick second question:
op('lister1').AddRow(rowNumber=None, rowData={"Name":"test"}, rowObject='__no__object__', rowDict=None, addUndo=True)
give me rowObject key error. The documentation says I have to add a rowObject key to the dictionary but that would be the content of the key?
This is a bit hard to answer without seeing your network, but my guess from what you have here is that what you want is actually:
op(ālister1ā).AddRow(rowNumber=None, rowDict={āNameā:ātestā}, addUndo=True)
This builds the rowObject and rowData out of the provided rowDict.
If this doesnāt work, attach your network and the results youāre trying to get and Iāll see if I can help.
Yes that did the trick, thank you!