31
Views
4
Comments
[Drag and Drop Sortable Table] drag and drop with nested tables
drag-and-drop-sortable-table
Reactive icon
Forge asset by Gerald Emmanuel Malaca
Application Type
Reactive

hi,

i have a table where i applied this function.

drag & drop work fine!

now, in the table, for some rows, i have inserted a second table, with this function.

in the nested table, d&d working fine, but in the main, it catch also the id of the second table.

i wrong something?

2023-03-13 10-26-05
Sriyamini

Hi,

I think same drag and drop handler is being applied for both levels without proper scoping. If you can share your OML or relevant code screenshot it will be easy to take a look and provide solution.

Thanks,

Sriyamini.J

UserImage.jpg
emanuele mantovanelli

i found something else that not working fine.

take my oml.

there is a table with sortable and nested a second table.

if i try the drag and drop, the event doesn t fired.

if i hide the container of second table, event work as shoud be.

ProvaEmanuele_2.oml
2025-07-22 10-30-27
Mandar Deshpande

Hi @emanuele mantovanelli 

In your case, you should disable drag on parent rows that contain nested tables.

If rows with nested tables should not be reordered, add a CSS class like: no-drag

Apply it to rows that contain the nested table

Configure the Forge asset: Draggable Selector:- exclude .no-drag

2025-08-20 12-58-03
ADITI CHATURVEDI
AI Generated

Hi, 

@emanuele mantovanelli 

I think it's not at fault. This behavior is normal when using the Drag & Drop Sortable Table (O11) asset that incorporates nested tables.

**Explanation**

The Forge component employs a JavaScript sorting mechanism that operates by monitoring drag events within a container. When a sortable table is embedded within another sortable table, both tables share the same drag context. Consequently, any drag events initiated in the nested table will elevate (bubble up) to the parent table.

Due to this event propagation:

- Drag and drop functionality operates correctly within the nested table.

- However, the parent table also detects the drag event, along with the row ID from the nested table.

- This leads to the parent table responding, even though the drag action was meant exclusively for the inner table.

This is a technical constraint related to nested sortable containers and is not due to misconfiguration or a bug in OutSystems.

**Recommended Approaches**

- Utilize distinct drag scopes or groups for the parent and nested tables (if the asset allows for it).

- Use custom JavaScript to prevent event bubbling from the nested table (stopPropagation).

- Temporarily disable drag functionality on the parent table while interacting with the nested table.

This answer was AI-generated. Please read it carefully and use the forums for clarifications
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.