How to drag-reorder rows in a Data Grid?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 1
- Joined: Thu Nov 12, 2020 8:38 am
How to drag-reorder rows in a Data Grid?
How do I drag-reorder rows in a Data Grid? I have to ask because, of course, it's not documented. I Googled and found some 10-year old threads but the code there didn't work for me.
-
- VIP Livecode Opensource Backer
- Posts: 9648
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: How to drag-reorder rows in a Data Grid?
Trevor may chime in here, but I believe you have to kludge this. Something like (super-pseudo)"
Seems easy...
Craig
Code: Select all
on mouseDown put the value of the "mouseLine" into startLine
create a phantom field containing startLine
on mouseMove set the y value of the phantom to the mouseV
on mouseUp put the value of the mouseLine into endLine
get the dgText of the DG
switch the contents of the two lines
set the dgText to the new configuration
Craig
Re: How to drag-reorder rows in a Data Grid?
Hi
Data grid forms now have a dgEditMode property. When in edit mode, the data grid displays an action control of the left hand side of each row and a reorder control on the right that allows you to drag-reorder rows.
We have a lesson on this here
https://lessons.livecode.com/m/datagrid ... -data-grid
If you just want the re-order control and not the action control you can do
I hope that helps.
Elanor
Data grid forms now have a dgEditMode property. When in edit mode, the data grid displays an action control of the left hand side of each row and a reorder control on the right that allows you to drag-reorder rows.
We have a lesson on this here
https://lessons.livecode.com/m/datagrid ... -data-grid
If you just want the re-order control and not the action control you can do
Code: Select all
set the dgProps["edit mode action select control"] of group "Data Grid Form" to empty
Elanor
Elanor Buchanan
Software Developer
LiveCode
Software Developer
LiveCode
-
- VIP Livecode Opensource Backer
- Posts: 9648
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: How to drag-reorder rows in a Data Grid?
Well, if not Trevor, then Elanor.
Craig
Craig
Re: How to drag-reorder rows in a Data Grid?
I was just passing
Elanor Buchanan
Software Developer
LiveCode
Software Developer
LiveCode