sort columns

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

sort columns

Ted Bracht-3
Hi Andy and Blair,
 
When adding lines to a list or changing the model of that list, the sort icon on the column that was last clicked stays visible, even though the list isn't sorted by that column anymore. I couldn't find a 'standard' way to 1. remove the icon or 2. resort by that column.
 
As in my app the user would want to retain the sort order, I had to add the following method to ListView:
 
ListView>>resort
lastClickedColIndex ifNotNil: [ :a |
    self sortOnColumn: (self columnAtIndex: lastClickedColIndex)]
 
Could/should that (and a way to remove the icon) be part of the standard image?
 
Thanks,
 
Ted
Reply | Threaded
Open this post in threaded view
|

Re: sort columns

Blair McGlashan
"Ted Bracht" <[hidden email]> wrote in message
news:[hidden email]...
> When adding lines to a list or changing the model of that list, the sort
> icon on the column that was last clicked stays visible, even though the
list
> isn't sorted by that column anymore. I couldn't find a 'standard' way to
1.
> remove the icon or 2. resort by that column.

Well there is the (admittedly private) method #forgetLastClickedColumn.

>
> As in my app the user would want to retain the sort order, I had to add
the
> following method to ListView:
>
> ListView>>resort
> lastClickedColIndex ifNotNil: [ :a |
>     self sortOnColumn: (self columnAtIndex: lastClickedColIndex)]
>
> Could/should that (and a way to remove the icon) be part of the standard
> image?
>

Actually I wonder if that ought not to happen automatically if the list is
changed?

Regards

Blair


Reply | Threaded
Open this post in threaded view
|

Re: sort columns

Ted Bracht-2
Hi Blair,

> >
> > Could/should that (and a way to remove the icon) be part of the standard
> > image?
> >
>
> Actually I wonder if that ought not to happen automatically if the list is
> changed?
>

Yes, I think it should.

Thanks,

Ted