I'm using an HorizontalList in my application to show some
This list is using 'gallery.photos' as a dataprovider.
'gallery' is an object, which contains the arraycollection
'photos', and that arraycollection contains several 'photo'
Now, I made some sort buttons/functions. At the end of these
functions I use the 'gallery.photos.refresh();' command to update
the dataprovider of the HorizontalList.
No problem with that, but after I use a sort button I can't
use any other sort buttons anymore (I can't click on the buttons),
but I have no idea why.
Here's an example of the functions I'm using:
private function sortNaam():void
var sort:Sort = new Sort();
sort.fields = [new SortField("naam",true,false)];
gallery.photos.sort = sort;
Then there's another problem: I made a sort button/function
to sort the pictures by date (for example 05-08-07). The thing is:
the pictures are allready sorted by date (the first picture has
'05-08-07' as a date, the second picture '06-08-07' and so on) when
the page is loaded (because that's the way they are sorted in the
XML file), but when I push the 'sort by date' button the function
sorts the pictures anyway and instead of being sorted in ascending
order (even if they allready are sorted in ascending order) they
are sorted in descending order (first 06-08-07, then 05-08-07).
And this is happening even if the SortField order option is
put on 'false'. This is the function I'm using:
What I meant by 'not being able to click on buttons' is: I
wasn't able to use (or click) the sort buttons I created once I
used one of the sort buttons, but I found the problem: every button
had the same function linked to its 'click' definition (so once I
used one of the buttons the other buttons didn't respond, which
makes sense) :)