Doubly List Insert Order Issue in RightSide list

Hello webix team,

Please refer below snippet.
https://snippet.webix.com/7d9gsagx

Here, I would like to have the right list preserve the order in which a user adds items to it and not order them as defined in the left list.

Please provide solution for the same.

Thanks.

Hello webix team,

Is there any solution for this? , Or Please suggest us alternative way for the same .

Thanks.

Hi,

When you add or remove some item to/from the right list, in reality it’s not adding/removal. Double List has 2 lists that contain same data. Filtering is what’s happening when you add/remove.
Well, I thought of a solution that besides filtering would sort values in the right list. The changes to the code are minimal, yet since there is a lot of private API involved (methods and properties the names of which start with _), I had to copy most of dbllist code…

https://snippet.webix.com/0xws1xwf

The real changes are:

  • in this._moved store some kind of constantly incrementing values instead of booleans (webix.uid() seems to be most helpful here), so it’s setValue and select redefined
  • when data in the right list are refiltered, sort them by this constantly incrementing value (that’s in _refresh, which is a private method…)

I marked the changes to the logic with // HERE! comments.

@kuro Thanks for your Solution!!