Add drag-and-drop functionality (List, FormfieldList, TreeSimple) - #197
Draft
clauspruefer with Copilot wants to merge 2 commits into
Draft
Add drag-and-drop functionality (List, FormfieldList, TreeSimple)#197clauspruefer with Copilot wants to merge 2 commits into
clauspruefer with Copilot wants to merge 2 commits into
Conversation
Copilot
AI
changed the title
Add drag-and-drop functionality to x0 framework
Add drag-and-drop functionality (List, FormfieldList, TreeSimple)
Jul 30, 2026
Copilot created this pull request from a session on behalf of
clauspruefer
July 30, 2026 10:56
View session
clauspruefer
requested changes
Jul 30, 2026
clauspruefer
left a comment
Member
There was a problem hiding this comment.
@copilot seems nice in the first place, but please change the following behaviour: getData, setData and appendData are the wrong functions, to be object transparent for all system objects please use the meta function pointers RuntimeGetDataFunc, RuntimeSetDataFunc and RuntimeAppendDataFunc.
Contributor
Author
Done — the drop handlers now use the meta function pointers:
Commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objects lacked any drag-and-drop support — rows couldn't be moved between lists, tree items couldn't be reparented, and form fields couldn't be populated by dragging.
New:
sysDragDropHandlerCentral coordinator attached to
sysFactory.DragDropHandler. Stores the dragged JS object reference and data payload so drop targets can retrieve them withoutdataTransferserialisation.List (
sysObjList)"DragSource": trueon a list → rows getdraggable="true"+dragstartstores row data."DropTarget": trueon a list →dropcalls existingappendData(). Self-drop is skipped.FormfieldList (
sysObjFormfieldList)"DropTarget": true→dropcalls existingsetData(), populating fields matching the dragged row's column keys.TreeSimple (
sysObjTreeSimple)"DragSource": true→ item containers become draggable;dragstartstores item config."DropTarget": true→ node header divs accept drops;dropcallsremove()+addObject()+renderObject()to move the item to the new node. Same-parent drop is skipped.sysObjTreeSimpleNodeconstructor gains aTreeRootObjparam (call sites updated).CSS
.sysDragDropOver— dashed outline + light tint applied to active drop targets viarelatedTargetchecks to avoid child-crossing flicker.Example
example/drag_drop/(example #16) demonstrates all three scenarios across three tabs using only JSON config:{ "SourceList": { "Type": "List", "Attributes": { "DragSource": true, ... } }, "DestinationList": { "Type": "List", "Attributes": { "DropTarget": true, ... } }, "DestinationForm": { "Type": "FormfieldList", "Attributes": { "DropTarget": true, ... } }, "DragDropTree": { "Type": "TreeSimple", "Attributes": { "DragSource": true, "DropTarget": true, ... } } }