3 Replies Latest reply on Jan 29, 2014 11:18 AM by philmodjunk

    Drag Records in List View to Sort them... Could it be possible?

    fabiuz

      Title

      Drag Records in List View to Sort them... Could it be possible?

      Post

           Hi,

           I have a list of costumers and I have to visit them periodically, the number and the selected costumers could change each time and so I have to resort them in the best and more logic order to reach them with my car.

           What I am doing now is to select the costumers and then I visualize them on a google map inside FMP and, in a new window, in a list view, I put a number in each record to set the order of visits. In this way I can view them sorted by their position number: I move the result to my FM Go device and I follow the list when I drive to them.

           This procedure works but is quite slow, it would be best if I could drag them in the needed position whithout the need of type a value for each one.

           Does anybody know if there is a way to do this with FM Pro or do you have any better solution to get the same result?

            

           thanks!

        • 1. Re: Drag Records in List View to Sort them... Could it be possible?
          philmodjunk

               This idea intrigued me. I've seen a much older demo that sorted via drag and drop in a portal so in moments when the headaches, chills and body aches diminished and allowed me to think more clearly, I've been playing with the concept.

               When I get a chance to take a fresh look at this in a few days with a clearer head, I may visualize a simpler process, but the following demo file does support drag and drop sorting. To move an item to a new location in the list, drag and drop from one "order" field to another. The "drag" record will be located just below the "drop" record except when dropping on the first record. Then, a dialog appears asking you to choose whether to make the drag record the first record or to drop it into place as the second record.

          https://dl.dropboxusercontent.com/u/78737945/DragAndDropSorting.fmp12

          • 2. Re: Drag Records in List View to Sort them... Could it be possible?
            fabiuz

                 Thanks! That is very suprising me!

                 I post the question but I do not believe that it could be possible!

                 I think your demo could work on FM Pro 11 too, I have to test it a little and undersdand something but it seems good!

                 Seems that it uses the FM function to copy text by selecting and dragging it with the onmodify script trigger. I have to study how you do that! :)

                 thanks

            • 3. Re: Drag Records in List View to Sort them... Could it be possible?
              philmodjunk

                   That's part of it, but using a global calculation field to identify the records involved in the drag is crucial. Global calculation fields return a value based on the most recently modified record and this is why it works. The On Modify auto-entered timestamp then distinguishes between the "drag from" and "Drag to" records since the "drag to" record's TS field will update and the "Drag From" field will not. This is used in a sort order specified in one of the relationships defined in the file.