ListviewColumn Sortable="0"

Discuss GUI programming with the RapaGUI plugin here
amyren
Posts: 352
Joined: Thu May 02, 2019 11:53 am

Re: ListviewColumn Sortable="0"

Post by amyren »

Found another issue that I suspect might be a bug.
When clicking in a column in order to set it sortable, it will return the wrong column number if the list is scrolled horisontally.
Resizing the columns so that the list fits the window without any horisontal scoll will make it return the correct columnnumber.
davec
Posts: 21
Joined: Thu Sep 03, 2020 10:39 pm

Re: ListviewColumn Sortable="0"

Post by davec »

I can only get to sort the first column that I click on (whether that be column a,b,c or d). If I selected another column, it won't sort, but if I go back to the first column I clicked on then I can sort that again.

Does it work like that for you? I see the little sort character "^" above the columns as I click on them, but they only sort for that first column once it is selected again.
davec
Posts: 21
Joined: Thu Sep 03, 2020 10:39 pm

Re: ListviewColumn Sortable="0"

Post by davec »

No sooner had I sent that post that I found the solution.

You cannot use

Code: Select all

moai.DoMethod("listview","Sort")
This will cause the issue I mentioned above.

Dave
amyren
Posts: 352
Joined: Thu May 02, 2019 11:53 am

Re: ListviewColumn Sortable="0"

Post by amyren »

amyren wrote: Wed May 05, 2021 11:52 am I found that there is no Event called when the column titles are clicked.
The "ClickColumn" attribute is only triggered when clicking at one of the items in the listview.
Is this a bug?
Answering myself here. I found that the issue above is not a bug, and that is the desired behaviour of ClickColumn.
What I was looking for was the listview.TitleClick that seem to do what I was looking for.

But for some reason changing from using ClickColumn to use TitleClick makes the sorting not work at all.
User avatar
airsoftsoftwair
Posts: 5425
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: ListviewColumn Sortable="0"

Post by airsoftsoftwair »

All those issues should be fixed by those changes in RapaGUI 2.0:

Code: Select all

- Change: The "Sorted" special position identifier for Listview.Insert() is obsolete now; when a listview
  has a column that is used for sorting, all new entries are automatically sort-inserted and the insert
  position is ignored; also, Listview.Move() and Listview.Exchange() can no longer be used for listviews
  that have a sorting column because the order of elements in a listview that has sorting activated is
  solely determined by the sort order and items cannot be positioned at arbitrary indices
- New: Added Listviewcolumn.SortOrder [ISGN] attribute; this can be used to set the sorting order of a
  listview column; it can be set to either "Ascending" (the default) or "Descending"; furthermore, you can
  also listen to this attribute to get notified when the user changes the sorting order by clicking a
  listview column's header
- New: Added Listview.SortColumn [ISGN] attribute; this attribute allows you to set which column should be
  the current sorting column; users can also click on the listview's header to change the current sorting
  column in which case you'll be notified in case you are listening to Listview.SortColumn
- Change: Listviewcolumn.Sortable is no longer restricted to just a single column; you can set it to TRUE
  for as many columns as you wish
Post Reply