Sherzod Posted October 6 Posted October 6 Overview Implements drag-and-drop from TUniTreeView to TUniStringGrid. All JavaScript logic is kept in a separate file: files/initTreeToGridDnD.js Selection Behavior Multi-selection enabled (MULTI). toggleOnClick = true → Ctrl+Click adds/removes nodes. allowDeselect = true → click on a selected node clears selection. Shift+Click selects a range. Plain click keeps only one node selected. Drag & Drop Drag: If dragged node is selected → drag all selected. If not → drag only that node. Drop: Inserts node texts into the target TUniStringGrid cell. Sends cell_changed to the server. Move (delete in tree): Copy by default. If moveOnCtrl = true → only moves when Ctrl is pressed. Sends move_nodes IDs to the server, deletion is confirmed server-side. Server-side (Delphi) UniStringGrid1AjaxEvent → updates grid cell (cell_changed). UniTreeView1AjaxEvent → deletes tree nodes (move_nodes) and syncs client with removeTreeNodesByIds. Initialization: UniSession.AddJS( Format('initTreeToGridDnD(%s,%s,%s);', [UniTreeView1.JSName, UniStringGrid1.JSName, 'true']) ); initTreeToGridDnD.zip 1 Quote
Tokay Posted October 6 Posted October 6 Thank you! Maybe some days we could find implementation of TUniDBTreeGrid and simply TUniTreeView I have own solution for DBTree, but it works not very well. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.