15
Views
2
Comments
Solved
[Drag and Drop Sortable Table] GetUpdatedOrder JS does not return updated list
drag-and-drop-sortable-table
Reactive icon
Forge asset by Gerald Emmanuel Malaca
Application Type
Reactive

I tried to implement this component. On the screen it works instantly. But the JS "GetUpdatedOrder" in the action "UpdateSorting" does not return an updated list. It stays empty. I therefore can not save the updated list.

I changed the order on the screen. I switched Id 240 with 104 (see bellow). I see the original list going in as input:

But then the JS returns an empty list:

Can you please help with fixing this problem? 

2024-06-24 15-21-58
Ahmed Hani
Solution

Hello Rogier,

Unfortunately, The latest version of this forge component introduced a bug in GetUpdatedOrder js code.

Replace the first line in the GetUpdatedOrder js code with new line to fetch the updated rows for the selected table correctly.

Old line:
var updatedrows = document.querySelectorAll('#' + + 'tbody.ui-sortable tr');

New line:
var updatedrows = document.querySelectorAll('#' + $parameters.SortListId + ' tbody.ui-sortable tr');

DragAndDropSortableTable Fixed.oml
2022-07-02 17-29-12
Rogier Mullaart

Thank you ahmed,

This solved my problem and it works perfect!

Regards,

Rogier.

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