Question about editing vertice/edge/face properties

MeshDataProperty

Hello.

Can someone explain how to access data of vertices/edges/faces and display them as working property like in the image shown? I want to reuse those in another area for my addon.

I think my issue right now is that this dives into bmesh + layers where I am not familiar enough to add one and one together by reading related stuff. Came back to this issue for a few months now.

Anyway, this is my current version about the vertex group list:

# find active vertex

ob = bpy.context.active_object
import bmesh
bm = bmesh.from_edit_mesh(ob.data)

ACTIVE = None
for elem in reversed(bm.select_history):
    if isinstance(elem, bmesh.types.BMVert):
        ACTIVE = elem
        break

# display vertex group weights

if ACTIVE:
    VERTEX = ob.data.vertices[ACTIVE .index]    
         
    for group in VERTEX.groups:        
        row = layout.row()
        Name = ob.vertex_groups[group.group].name
        row.prop(group, "weight", text=Name, slider=True)

Problem: bpy.context.active_object.data.vertices provides the property for vertex group weights but going this way has no effect in actually changing the value, it also resets after switching modes.

Can anyone help?