Get Previous and Next Element Ids in jQuery ui sortable.

Get Previous and Next Element Ids in jQuery ui sortable.

Hello,

I am using jquery ui sortable in my website. The problem I am facing currently is that I am not able to determine the previous and next elements' id of the currently sorted element. The requirement is that I have a jquery ui sortable list in my website and I have to implement drag and drop functionality using that i.e., if I drag the element from ui sortable and drop it at the droppable area then I should change the status of that dragged element. The only way I can think of regarding this is to drag the element to the droppable area and when I drop it in the droppable area, remove the element the current element and create a new element in the same position in the list from where an element was dragged. For this I need the ids of the previous and next elements. If Anyone has a better solution to implement this then please share it. Any help will be greatly appreciated.

Thank You.