Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Drag and Drop Grid or List Order

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Drag and Drop Grid or List Order

    I'm trying to figure out how to implement a Drag and Drop order change for a Grid or List control. Has anyone figured this out at all?

    #2
    Re: Drag and Drop Grid or List Order

    Selwyn posted drag and drop between 2 Lists. I wonder if the Target List setup was altered to represent the Source List if that would work out.

    http://downloads.alphasoftware.com/A...easenotes.html

    search for drag and drop

    Comment


      #3
      Re: Drag and Drop Grid or List Order

      There is a part of the list control controls that move a record up and down, but can't figure out how it works to commit the order back to the database.

      It's video UXL_V12--21 in the Video list from the Developer. Or search for 'reorder' from Developer.

      Comment


        #4
        Re: Drag and Drop Grid or List Order

        The video you're referencing isn't using drag and drop. The drag and drop process uses the List methods appendRows, insertRows, and removeRows. The "List Move" video you reference uses other methods, like _listMoveCurrentSelection.

        The Move example processes the end result of your moves. You could then extend that XBasic code and write back out to your tables. The drag and drop doesn't take into account saving that data back to tables in the order established.

        There are a number of ways to go about this, depending on how your data is structured. You could employ an "order" column into your table... changing the List "order" column value each time the List order changes... then sync your List.

        Comment


          #5
          Re: Drag and Drop Grid or List Order

          Yeah, I know. That's a different way to do it which would be fine. The Up/Down/Top/Bottom buttons.

          Comment


            #6
            Re: Drag and Drop Grid or List Order

            What is your Table / List structure?

            Comment


              #7
              Re: Drag and Drop Grid or List Order

              It's a simple SQL order status table.

              ID
              Status
              Status Description
              Color
              Order

              And a basic list with a detail view. I do have an Order field that I was using in a Grid by manually entering a number in to set the order, but reordering is a pain. The Order is used so when the data shows up in a dropdown box on an order entry page, I can change the order in which they appear. The Order field is selected but not showing in the List Layout.

              Screen Shot 2016-12-15 at 7.09.55 PM.png

              Nothing fancy or crazy on the list except for the client-side conditions to change the color. And that's not perfected yet.

              List name is CustomerStatus
              SQL Table is OrderStatusCustomer

              Comment


                #8
                Re: Drag and Drop Grid or List Order

                The attached UX uses a table structure similar to yours but I couldn't, in good conscience, use the column name "order"... it's a reserved word. I change the column name "color" as well... way too close to reserved stuff. Use StatusOrder and StatusColor... much more helpful. "ID" is another one I'm not crazy about, but I didn't change that. I used an AlphaDAO Connection String name of "Test".

                This UX List moves a row and then loops through the List updating the StatusOrder column for each row. You're not going to have 10k rows, so this process should be ok. Then we sync the updated List.

                Now... normally, as each row is updated with a new order #, the row itself goes dirty and an orange triangle appears letting you know the row has changed. However, since we're updating all rows, we don't really want to see an update indicator on each row... so the UX Local CSS definitions makes that triangle transparent.

                The Javascript function that moves and updates the rows sync the List on each move. However, you don't have to do that. You can move around a bunch of rows... and then add a button to sync when you want to. That's put control, and error, back into the users hands... so it's whatever you'd like to do.

                Overall, we're using the data connectivity of the List to do all this. You don't have to. You can always use a Server-side function to do your updating.
                Attached Files

                Comment


                  #9
                  Re: Drag and Drop Grid or List Order

                  Easy enough. I think I was WAY overthinking it. This give me a great starting point. Thanks!

                  Comment


                    #10
                    Re: Drag and Drop Grid or List Order

                    I was excited to find this thread and the solution from David, I usually use a callback to set the list order when it is changed, but sometimes this is jittery when on a slow connection and the javascript solution seems a better way to go. However on testing, if the list is filtered (I did this on the statuscolor field) I get a write conflict error on the statusorder field.

                    Is there anyway of avoiding this error?

                    Comment


                      #11
                      Re: Drag and Drop Grid or List Order

                      The only time I got a write conflict error was when I was clicking the up/down so fast in a random order that I think the Javascript got confused.

                      Why are you filtering the list by statuscolor? Not following the application you're using this for.

                      Comment


                        #12
                        Re: Drag and Drop Grid or List Order

                        I only used the statuscolor field as a filter for testing. I have several real world lists that are filtered on a parent-child list situation whereby the child list needs to be sorted. One such example would be a parent list of invoice headers, whereby a long running job is invoiced each month with a cumulative amount. the contents of last months invoice items are copied to a new invoice then added to, then sorted.

                        Comment


                          #13
                          Re: Drag and Drop Grid or List Order

                          If you don't filter it does it work?

                          I'd have to see what you did in order to help. I think I understand. My real world was an order status like "In Art Dept", "New", "Completed", etc. The results of this are then ordered in a dropdown box elsewhere, sorted by StatusOrder. The list that shows the statuses is filtered based on a company ID, as this is a multi-company app, and that works just fine.

                          Comment


                            #14
                            Re: Drag and Drop Grid or List Order

                            Yes without the filter it is fine.

                            Attached is DavidK's component, the only things I have changed are the connectionstring and the filter statuscolor=1 has been added

                            ux_List_ReOrder.a5wcmp

                            Comment


                              #15
                              Re: Drag and Drop Grid or List Order

                              Thanks for providing that sample. I don't think this has anything to do with a filter. The issue is probably due to an Alpha version difference. My component does not have write conflicts. But when I run your component it does. I deleted your List... just the List... and then added it back in... connecting it to the existing Detail View fields. All was good again... no write conflicts.

                              Here is the clue (apart from the error) that something isn't write (get it?). Run your UX... and without changing the order, change the description and click Save. You'll see your edit does not display in the List. There's a break somewhere. Delete and re-create your List and it should be ok.

                              Comment

                              Working...
                              X