17
Views
1
Comments
Solved
[SortableJS] Refresh of the underlying data source
sortablejs
Reactive icon
Forge component by João Lopes
Application Type
Reactive

Thanks you very much João, for the very cool component.

Maybe you can give me some advise for my scenario:

I do have a huge list as the drag source. So I want to allow the user to filter this huge list and tried to achieve this using an Aggregate with a filter. 

Unfortunately the way I use the SortableJS component changes the frontend (the DOM?) which breaks the outsystems update functionality and as soon as I refresh the data source the GUI breaks. I do get an execption and the whole GUI (drag source) disappears:



I can even reproduce this in your example code.

- I replaced the variable representing the left list with a data action providing the same data.
- I added a button which actually triggers a refresh of the data action created in step one.

Refresh now works as long as I did not DnD anything and breaks as soon as I moved the first element around.

Any idea why this happened, if I can overcome this limitation and how?


Thanks,

Matthias




Solution

I crawled through the SortableJS forum and figured our a solution.

Basically I copied the DOM before the Drag and restored it on Drop. 
Then the original Outsystems page refresh works again.
You just need to ensure to reflect the drag and drop actions to the underlying object model.

See this link:

https://www.outsystems.com/forums/discussion/91490/if-the-drop-source-uses-a-data-source-a-refresh-of-the-data-source-breaks-app/#Post391316


BR
Matthias

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