Colin Tree List view sorting ascending & descending

If you don't want to rely on the Text1 keys from the ListView as ABG mentions, then you need to sort the doctionary_list before you add its values ​​to the ListView.

Patryk :+1: now it is working, great, i can sort the dictionary in both directions.
Are Text1 and Text2 fixed variables in Listview element for main and subtext?

ABG, i do not use the list block "lookup in pairs", don't know why the error message appeared. :confused:
My aim is to sort the listview of colins extension, as it is not possible i try to use Listview component with sorted lists internally and then copy the items to the listview extension.
Is there a better way to sort items in colins listview directly?

As of now, these are permanent keys for ListView and there are no plans to change them. I don't think there would be a reason to change them. But if you have concerns about this, like ABG, I mentioned in a previous post how to do it differently.

1 Like

Am I missing something ?

colinTree.aia (51.5 KB)

Sorry, I don't support extensions.

1 Like

Tim, great :+1: thx, nothing is missing, everything works.
I thought i need a dictionary block for a list of pairs, but you dont need it.
I will need to check the precedes comparison function from Button2 and 3.
Is it also working with longer lists than 3? Wondering about the index 2.

index2 is the title in each element, e.g. Orange, Blue,Green

Yes, the blocks I showed will work for a list of any length

1 Like

Since Colin's ListView doesn't need dictionaries, it's a list of lists.

1 Like

I can use list of lists with listview sufficiently.
So what is the advantage of a dictionary for listview?

What do you mean?

Someone came up with this and we can't talk about advantages or disadvantages. It could have been based on a list of lists, but someone based it on a dictionary and that's also good. In programming we have so many possibilities that there is no single good solution.

My listview is working fine together with an list

ListView or ColinTree-ListView? It is important to remember that ColinTree-ListView is not based on RecyclerView and with large amounts of data performance may be poor.

1 Like

ok, thank you for this important hint.
I actually compare both, ListView and ColinTree Listview to check which is more comfortable to modify and convenient for enduser (using iconimage, extrabuttons,..).
Actually i also search for a move function, to move elements up and down in a listview

Search the forum for extensions or complex blocks for that, there are several different ways you can "move" listview items up and down (but I would suggest you do this with the underlying list, then re-display the listview!)

I am trying to move the elements by using this blocks, but the colintreelistview extension does not offer a selectionindex.
I do not use a list underlying list so far.
How can i move up and down the items?

Um, it is right there in front of you...

image

you also have this:

image

1 Like

My move block is working, now i want to select the new element index by blocks, i mean to set the index+1 like i can do with a select list item block, but the colin treelistview does not have a set index block, only lastclickedelement or getelement. I do not want to click each time to move an element.

I also cannot change background color of a selected colin element.

I only found your similar blocks for listview
image

How are you going to select a listview element to be moved if you are not clicking on it ?

You have your underlying list, each list item has an index ?

I can select a listview item in the underlying list, but i am missing the block to the colin listview.
I have no set block like this
image

Use this block with the index from the underlying list ?

image