This sandbox uses the SortableJS library along with the jQuery SortableJS binding. Features illustrated here are sorting, groups, the onSort event, and collecting the sorted elements in an array.
Drag and drop items in each list, and drag them between lists (groups). Then click the button to read the order in the console.Observe that the 'toArray' function collects the 'data-id' for each element.
The necessary libraries are in the script tags below. In my WordPress testing environment jQuery 2.2.4 is required. Even though WordPress bundles jQuery, the version supplied doesn't seem to support the animation effects in SortableJS -- it's just very rough without jQuery 2.2.4.