Well, I'm still having issues. This was the only way I could get things to
work. Can you tell me what I've done wrong? Thanks.
<mx:HTTPService id="getMajorsVisitdates" url="ServiceServlet">
<mx:request>
<action>majors_visitdates</action>
</mx:request>
</mx:HTTPService>
<mx:ArrayCollection id="col" sort="{s}"
source="{getMajorsVisitdates.lastResult.root.major.toArray()}">
</mx:ArrayCollection>
<mx:Sort id="s">
<mx:SortField name="name">
</mx:SortField>
</mx:Sort>
On Thu, May 1, 2008 at 7:51 PM, Daniel Gold <[EMAIL PROTECTED]> wrote:
> The List is simply the view for your data. You need to sort the
> dataProvider of the list so when the List is iterating over your data
> rendering it, it will be accessing the data in the order specified.
>
> I would pull the data from lastResult, store it in an ArrayCollection or
> XMLListCollection(since it seems like you might be using XML), and then you
> can set the Sort on the collection as specified in the docs:
>
> http://livedocs.adobe.com/flex/3/langref/mx/collections/Sort.html
>
> Sort also allows you to set a custom compareFunction if you need more than
> a simple ascending/descending sort on the dataFields.
>
>
> On Thu, May 1, 2008 at 10:53 AM, Justin Stanczak <[EMAIL PROTECTED]>
> wrote:
>
>> I have the following:
>>
>>
>> * <mx:HTTPService id="getMajorsVisitdates" url="ServiceServlet">
>>
>>
>> <mx:List id="majorsList" width="342"
>> dataProvider="{getMajorsVisitdates.lastResult.root.major}"
>> change="selectMajor()" height="200" labelField="name" x="10"
>> y="36"></mx:List>*
>>
>>
>> How do I sort the majorsList? Seems like it should be easy, but I'm not
>> totally understanding how to do it with a List. Thanks.
>>
>> --
>> "All that is necessary for the triumph of evil is that good men do
>> nothing." - Edmund Burke
>>
>
>
>
--
"All that is necessary for the triumph of evil is that good men do nothing."
- Edmund Burke