21
Views
5
Comments
[Sortable AF] After changing the List, I want to save the way its sorted
sortable-af
Reactive icon
Forge asset by Greg Whitten
Application Type
Reactive
Service Studio Version
11.55.2 (Build 63874)

There is a Web block with a list, where I am using Sortable AF, but I save the changes(button) on the parent screen, When I switch the Items and click the button, I want the changes made to be saved. 

KanbanModule.oml
2021-03-12 19-55-30
Greg Whitten
 
MVP

There is a client action called ToArray that will return the list of data-id's in the order of their current sorting.  Then you can use that array to update whatever attribute you are using to track the order of your entities.  The SaveOrder screen in the demo gives an example.

UserImage.jpg
Chris Barlow

If instead of the order, I want to change the Phase that the Item is within after I move it around, would I need to use an Update method or do i follow the same path as the demo?


2021-03-12 19-55-30
Greg Whitten
 
MVP

I'm assuming each phase has its own sortable, so in addition to updating the order you can update the phase as well.

UserImage.jpg
Chris Barlow

I am currently only using sortable AF inside the blocks(for the items), My current issue is when I move the item from one Phase to another it is only happening visually. I cant figure out how to update so that it carries over in the logic as well. Do I need to use sortable in both the Web block(items) and Web Screen(phases)?

2021-03-12 19-55-30
Greg Whitten
 
MVP

From a high level you'll want each column (phases) to have its own sortable AF object.  There's an example in the demo that shows how to move items from one list to another.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.