flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Harui <aha...@adobe.com>
Subject Re: help with moving list elements up and down
Date Wed, 13 Mar 2013 15:12:47 GMT
Is there a sort applied to the collection?  Then you can't re-order it.


On 3/13/13 4:48 AM, "Lucas Junqueira / Ciclope" <lucas@ciclope.art.br>
wrote:

> Nope... nor validateNow or setting the item, instead of the index worked...
> 
> 2013/3/13 Evyatar Ben Halevi-Arbib <evyatarbh@gmail.com>
> 
>> I suggest using the selectedItem property instead of selectedIndex.
>> I witnessed cases where changing the selectedIndex had no impact on the UI
>> and using selectedItem did work properly.
>> 
>> Good luck,
>> Evyatar
>> 
>> On Tue, Mar 12, 2013 at 11:29 PM, Alex Harui <aharui@adobe.com> wrote:
>> 
>>> Try calling validateNow after changing selectedIndex.
>>> 
>>> 
>>> On 3/12/13 2:19 PM, "Lucas Junqueira / Ciclope" <lucas@ciclope.art.br>
>>> wrote:
>>> 
>>>> Hi, I was trying to create an order list withe the spark list control.
>> I
>>>> would like to move itens up and down, but this seems to be a problem.
>>> Here
>>>> is the code I'm trying to use to move an item up. Can anyone tell me
>> why
>>> it
>>>> isn't working? The item label is, indeed, changed, but the list
>> selection
>>>> not (the selected index does not change):
>>>> 
>>>> if (this.sequenceList.selectedIndex > 0) {
>>>>     var list1:Object = new Object();
>>>>     var list2:Object = new Object();
>>>>     list1.label =
>>>> String(this.sequenceListData.getItemAt(this.sequenceList.selectedIndex
>> -
>>>> 1).label);
>>>>     list1.data =
>>>> String(this.sequenceListData.getItemAt(this.sequenceList.selectedIndex
>> -
>>>> 1).data);
>>>>     list2.label =
>>>> 
>>> 
>>> 
>> String(this.sequenceListData.getItemAt(this.sequenceList.selectedIndex).label
>> )>
>>> ;
>>>>     list2.data =
>>>> 
>>> 
>> 
String(this.sequenceListData.getItemAt(this.sequenceList.selectedIndex).data)>>
;
>>>>     this.sequenceListData.getItemAt(this.sequenceList.selectedIndex -
>>>> 1).label = list2.label;
>>>>     this.sequenceListData.getItemAt(this.sequenceList.selectedIndex -
>>>> 1).data = list2.data;
>>>> 
>>> this.sequenceListData.getItemAt(this.sequenceList.selectedIndex).label
>>>> = list1.label;
>>>> 
>>> this.sequenceListData.getItemAt(this.sequenceList.selectedIndex).data =
>>>> list1.data;
>>>> 
>>>>     // the following does not work
>>>>     this.sequenceList.selectedIndex = this.sequenceList.selectedIndex -
>>> 1;
>>>> 
>>>>     // tryied with and without the refresh
>>>>     this.sequenceListData.refresh();
>>>> }
>>>> 
>>>> Thank you all!
>>> 
>>> --
>>> Alex Harui
>>> Flex SDK Team
>>> Adobe Systems, Inc.
>>> http://blogs.adobe.com/aharui
>>> 
>>> 
>> 
> 
> 

-- 
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui


Mime
View raw message