Re-Drag line in list to new row
Many thanks Alan and Phil
Alan thanks for the method etc. I would not have managed to get that without help. I have got the line moving and now need to sort out the rest of my problem with it. I am having to spend the next 3 days in our sailing club race committee boat so I will get to it again early next week
From: “Alan Perrin” <firstname.lastname@example.org <mailto:email@example.com>>
To: “‘OmnisDev List – English'” <firstname.lastname@example.org <mailto:email@example.com>>
Subject: RE: Drag line in list to new row
Message-ID: <firstname.lastname@example.org <mailto:email@example.com>>
Content-Type: text/plain; charset=”utf-8″
This is the code in the $event method of MyList which I use to rearrange line positions within the list using drag and drop. :-
DroppedOnSameLine Boolean False
LineNumber Number (Long Integer)
LineRef Item reference
Ensure the following properties are set :-
Do $cwind.$objs.MyList .$dropbetweenlines.$assign(kTrue)
Code behind list :-
Quit event handler (Discard event) ;; Only drag and drop to re-order fields is allowed.
; Rearrange the order of the lines in the list :-
Calculate LineNumber as mouseover(kMLine)
Do pDragValue.$first(kTrue) ;; Sets the first selected line to be current.
Do pDragValue.$addbefore(LineNumber) Returns LineRef ;; Adds an empty line before the dropped line number.
Calculate pDragValue.$line as pDragValue.$line+1
Do LineRef.$assignrow(pDragValue) ;; Assign the data form the current row to the new empty line
Calculate LineNumber as LineNumber+1
Do pDragValue.$next(pDragValue.$line,kTrue) ;; Make next selected line current
Calculate DroppedOnSameLine as kTrue
Break to end of loop
Do pDragValue.$remove(LineRef) ;; delete the inserted blank line
Do pDragValue.$remove(kListDeleteSelected) ;; delete the original data
Do $cinst.$redraw() ;; redraw list
Hope that helps
From: omnisdev-en [mailto:firstname.lastname@example.org
Sent: 31 August 2017 11:14
To: Omnis List <email@example.com <mailto:firstname.lastname@example.org>>
Subject: Drag line in list to new row
I am trying to reorder a list by by dragging a line from say line 5 to drop it into the position say between lines 2 and 3 in the same list, so that the dragged line becomes #L=3. Not getting much success. I can drag the line but it won?t drop into position. I am using 4.2.
If anyone could show me the event method for the list and perhaps a screen shot of the property action tab plus anything else I need to make it work, I would be very grateful.
Manage your list subscriptions at lists.omnis-dev.com