Show index (order) in a drag:'order' ui.list

Hello,

I have a ui.list with the option drag:‘order’, so the user can order the items. I would like to display the current position of the Item.

Something like:

List:
#1 - Brazil
#2 - Denmark
#3 - Spain

And let’s say the user change Spain position:

List:
#1 - Brazil
#2 - Spain
#3 - Denmark

How could I achieve this?

Thanks in advance,

Hello,

In such case, the easiest solution is to use a list-like datatable, as its template stores the index of the data item. For example:

http://webix.com/snippet/07480873

As the index is undefined while dragging, I suggest also modify the visual representation of the item as described below:

http://docs.webix.com/desktop__dnd_events.html#displayingtitlesofdraggeditems