Flex :: ArrayCollection Removing Sort?

Aug 3, 2009

After applying a numeric sort to my dataprovider(Array Collection), I can not reorder the items via a tilelist. Do I need to remove the sort from the arrayCollection. If so, is it just a case of setting collection.sort = null ?

var sortField:SortField=new SortField();
sortField.name="order";
sortField.numeric=true;
var sort:Sort=new Sort();
sort.fields=[sortField];

View 3 Replies


Similar Posts:


Actionscript 3 :: How To Sort A ArrayCollection In Flex

Feb 24, 2012

I want to sort Arraycollection in fieldName as ascending...heres my code and i wan to know whether its rite.

public static function arrayCollectionSort(ar:ArrayCollection, fieldName:String, isNumeric:Boolean):void
{var dataSortField:SortField = new SortField();

[code].....

View 3 Replies

Flex :: ArrayCollection Sort By Czech Locale

Apr 29, 2011

how can i sort String field in ArrayCollection by czech locale... a á b c č d ď e é ě f g h ch i í .....

alike as Collator("cs-CZ", CollatorMode.MATCHING); for Array

View 1 Replies

Flex :: Refresh - Applying The Sort/filter On An Arraycollection Without Dispatching Event?

Aug 3, 2011

I have a object that is extended from arraycollection. This object has to access and manipulate the arraycollections source object. When this happens, the local sorted/filter copy of data goes out of sync with the source data. To line things up correctly, the sort/filter needs to be re-applied.

To do this normally, you would call refresh() on the arraycollection, but this also broadcasts a refresh event. What I want is to update the sort/filter without dispatching an event.Having looked into the ArrayCollection class, I can see it is extended from ListCollectionView. The refresh function

public function refresh():Boolean
{
return internalRefresh(true);
}

is in ListCollectionView and it calls this function

private function internalRefresh(dispatch:Boolean):Boolean
{
if (sort || filterFunction != null)
{

[code]....

annoyingly, that function is private and so is unavailable to and class that extends ListCollectionView. Also, a lot of what is in the internalRefresh function is private too.Does anyone know of a way to call internalRefresh from a class that extends ArrayCollection? Or a way of stopping the refresh event from being dispatched when refresh is called?

View 2 Replies

Flex :: Removing Sort Arrows From AdvancedDataGridColumn Header

Apr 26, 2010

I am doing this simple project using Flex 4 SDK and I got stuck with this simple problem: I have turned sortable property for AdvancedDataGridColumn to false, but the column header is still rendered as:

As You can see, my label for this header is "06", but the column header is divided and it keeps the place for sort arrow.

How can I change this? I would like my column header to contain only my label.

View 2 Replies

Flex :: Iterating Over ArrayCollection While Adding And Removing Items

May 24, 2011

I want to iterate over an ArrayCollection in Flex while there can be items added and removed.

Since i didn't find a way to use a "classic" Iterator like in Java, which would do the job. I tried the Cursor. But it doesn't really work the way i want it to be ;) So how do I do it nicely ?

var cursor:IViewCursor = workingStack.createCursor();
while (!cursor.afterLast)
{

[Code]....

View 5 Replies

Flash :: Flex - ArrayCollection - Adding And Removing A FilterFunction?

Jun 13, 2011

I am using Adobe Flash Builder 4 Premium. I have a mx:DataGrid and a s:TextInput, and I am trying to set up a search box that filters the DataGrid on each key press.his page shows a nearly perfect example of what I'm trying to do, except that I'm setting this up in a s:TitleWindow, which is brought up as a popup using the PopUpManager. The list I'm trying to filter can be very large. It is a list of usernames, fetched from a MySQL database via PHP. Since it can be so large, I want the list to be populated once in the main application and then referenced in the popup window so that it doesn't have to fetch all the usernames each time the user opens the popup.I have all of this working fine for the first time you bring up the popup, but if you close it and bring it up again, I get this runtime error:I also get this error if I attempt to set the filterFunction back to null just before closing the popup.See sample code below:

Main Application:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

[code]......

View 2 Replies

Arraycollection - Flex 3 Removing Items From An Array Collection When The User Clicks A Button And Reflecting That In A Repeater

May 18, 2011

I have an arrayCollection with the following structure:

[Code]...

the AC is defined as follows:[Bindable] private var projectErrorsAC:ArrayCollection = new ArrayCollection;

I'm using this AC in a repeater to display each error. After each error is shown, I've placed an "Accept" and "Deny" button. Once the user clicks either one of these buttons, I'd like to call a function that removes the particular error from the AC. Here's what I have so far:

[Code]...

View 2 Replies

Actionscript 3 :: How To Sort Time ArrayCollection

Mar 22, 2011

How do I sort this time ArrayCollection? I need it to be sorted from earliest to latest.

View 2 Replies

Flex :: Mxml - Components Bound To Empty ArrayCollection At Load Time Don't Render As Expected When The ArrayCollection Is Updated?

Oct 27, 2009

I'm new to Flex and am using TileList bound to an ArrayCollection. The array collection is empty at load time, and then updates with the results from am HTTPService call. The problem is that the item renderers aren't being rendered as expected, I'm guessing because there was no data when they were first rendered at load time. Here's simplified example:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" >
<mx:Script>

[code].....

View 2 Replies

Actionscript 3 :: Removing Multiple Items From An ArrayCollection Using SelectedIndices

Dec 5, 2011

I have an ArrayCollection that is the dataProvider for a spark.components.List, which has allowMultipleSelection="true". There is a "Remove Selected Items" button which initiates the removal of all the selected items from the ArrayCollection upon being clicked.

I currently use the following method:

myList.selectedIndices.sort(ascendingSort);
// remove items, counting backwards
for (var i:uint = myList.selectedIndices.length; i > 0; i--) {
myArrayCollection.removeItemAt(myList.selectedIndices[i-1]);
}

where ascendingSort does what you expect ;). It works fine, and I know that it will always work.

However, I did take note that if I neglected the sort altogether, to my surprise the removal still worked. The reason for this turned out to be that, when the removeItemAt is called, the selectedIndices are correspondingly updated.

So my question is: Can one rely upon a removeItemAt call updating the values in the selectedIndices? or might that turn out to be different between runtimes and/or Flex SDK versions?

View 2 Replies

Flex :: Sort Collection And Sort Remains In Place When Adding To Collection?

Jun 30, 2011

When I get a collection back from the service tier, I create an ArrayCollection and apply a sort. When I add an item to the collection later on, the sort is still in place? It seems to be the case. I thought I was only sorting it once, not applying a sort that will stick??Here is the method for adding an item:

private function onAddNewClick():void
{
var fileTemplate:FileTemplateDetailDTO = new FileTemplateDetailDTO();

[code].....

View 4 Replies

ActionScript 2.0 :: Gallery + Sort By List + Sort By Thumbs : 3 XML Files?

Mar 25, 2005

I need help with page "Thumbs" (as first frame), page "List" (as second frame) and Image gallery (as third and base). So, every frame have one own XML file...When you choose some thumb or list line, you must came to this image in the gallery. Easy, sure.. but i don't know what Function exactly i need to use.It's one flash move, hence it doesn't work with getURL or loadMovie...Some exemple with 3 separate pages here: yuri.fr

View 1 Replies

ActionScript 3.0 :: Sort An Array By Two Or More Sort Thingy's

Nov 27, 2010

I have an array that is structured like so.

[Code]....

Normally, I'd just like to sort the array alphabetically using the name field, which is easy enough using the following code. However, I'd like to create a radio button called 'loadedRadioButton' and when it's click on, I'd like to sort the array on the loaded value first(any items with loaded=true should be at the top, sorted alphabetically), then afterwards, any other items with loaded=false, sorted alphabetically should follow afterwards, how can I do it?

View 0 Replies

ActionScript 3.0 :: Sort Function - Sort The Video By Last Name

Mar 5, 2010

Here is a website that needs a sort function to sort the video by Last name. [URL] I would like to have a link that popped up videos sorted by last name. Please take a look at the following site for an example. [URL] When you click on seconds in the menu below, it opens a pop-up window that sort the videos in a certain way. If you are willing to,I will give you the source file of what it currently has on [URL]

View 1 Replies

Actionscript 3 :: ArrayCollection Index Got Changed After Filter The Arraycollection?

Oct 7, 2011

I have a advanced datagrid and populating some data by using arraycollection. And i am filtering the arraycollection, the arraycollection index got changed.

Arraycollection:- [0] - name: abc
[1] - name: hello
[2] - name: hello1
[3] - name:hai

after filtering the arraycollection as 'hell' , the array collection is displaying like the below:

Arraycollection:-
[0] - name: hello1
[1] - name: hello

Can i know the reason why the index got changed after filter it?

* no server side code for filtering. it is only flex side filtering.

View 2 Replies

Flex :: Sorting - Best Way To Custom Sort A Flex Array?

May 11, 2011

Here are the strings this array can contain (in the correct order):

'recipients,' 'columnSelector,' 'headerImageLink,' 'title,' 'mainText,' 'text,' 'bodyImage'

Now, to sort them, I obviously don't want to do something like this:

if( a == 'columnSelector' && b == 'headerImageLink' ) return -1;
else if( a == 'columnSelector' && b == 'title' ) return -1;
else if( a == 'columnSelector' && b == 'mainText' ) return -1;

So that brings up an interesting thing. I know you can optimize the above some using something like this:

if( a == 'columnSelector' || a == 'bodyImage' ) return -1;

This would get the last two, but lately I have just wanted community input on issues I have had in the past. So the question is, what is the best way to write a custom sort, using a relatively random order (not alphabetical, etc)?

View 1 Replies

Flex :: Datagrid - ItemRenderer Flex Values Getting Not Rendered According To ArrayCollection Provider?

Feb 4, 2011

i have a problem using the itemRenderer functionality. When using an ArrayCollection the visible Data in the DataGrid using the itemRenderer will be rendered just fine. But if i start scrolling the entries are repeating in the cells using the renderer. The cells are not filled with date according to the id. What mistake i'm doing here.

I read a lot of the explainations like:

[URL]

here is the code for the set data function (itemRenderer is extending HBox):

override public function set data(value:Object):void {
_data = value;
if(data!=null)

[code]....

View 1 Replies

Flex :: ArrayCollection Versus Vector Objects In FLEX?

Apr 20, 2010

the applicable differences between an ArrayCollection and a Vector in flex? I'm unsure if I should be using one over the other. I saw that Vector is type safe and that makes me feel better, but are there disadvantages?

public var ac:ArrayCollection = new ArrayCollection();
versus
public var vec:Vector.<String> = new Vector.<String>();

View 4 Replies

Flex :: Sort Contents Of ComboBox?

Sep 19, 2009

I need to be able to sort the items of a combobox so they will be in alphabetical order. how would I do this?

View 2 Replies

Flex :: Sort The Tabs As Each New Tab Is Loaded?

Feb 13, 2011

Im loading tabs for an accordion control at runtime. The number of tabs is determined by the role of the user. Each tab comes from a module so the load time is variable. As a result the list order changes every time the app is run.Is there a practical way to sort the tabs as each new tab is loaded?

View 1 Replies

Flex :: Sort Columns In AdvancedDataGrid?

Mar 15, 2011

I'm making an application where I display an AdvanvedDataGrid with one column with dates(in format DD/MM/YYYY) and another with datetimes (in format HH:MM). I'd like to sort dates according with the datetimes as well(just clicking in the header of the column), there is an examplen of the expected behaviour:

02/02/2011 | 10:42
03/02/2011 | 09:45
02/02/2011 | 11:45
03/02/2011 | 11:30

[Code]....

_currentDatosBusqueda is an arraycollection I receive from the Server (with the correct format of dates and datetime).

View 2 Replies

Flex :: Sort Months Using SortField?

Mar 24, 2011

I am sorting xmllist profilexml. In the list dates and months are sorted using SortField. It is sorting up to September month. After that Oct, Nov, and Dec are coming and displaying on the top in the datagrid.

finalList = new XMLListCollection(profileXml);
var sortL:Sort = new Sort();
sortL.fields = [new SortField("startDate", true)];

[Code]....

<startDate>2/15/2011</startDate> as per my understanding it is sorting until 0-9 numeric fields only. Is there anything I need to add in this code for numeric sorting?

View 1 Replies

Flex :: Convert ArrayCollection To XML?

Jul 24, 2009

In Flex, it's easy to convert the XML to Object and to ArrayCollection by using var decoder:SimpleXMLDecoder = new SimpleXMLDecoder(); decoder.decodeXML( xml );

But is there a good way to convert ArrayCollection to XML.

View 3 Replies

Php :: Zend_AMF: Get A ArrayCollection From Flex?

Sep 22, 2009

I currently have an arrayCollection in Flex and I want to sent it to PHP (Zend_AMF). According to the Zend_AMF wiki, sending an arrayCollection over directly will force Zend_AMF to cast the arrayCollection as an object which is no good. I'd rather have an array of my models. I assume the best way would be to convert the arrayCollection to an array in flex and then send it over. Is this true, and if so how would I do that in Flex 3? If you have a better recommendation,

View 1 Replies

Flex :: Sorting An ArrayCollection?

Oct 21, 2009

Is there any way in Flex where in we can sort an arraycollection based on strings .I have a dataprovider with strings like "Critical" "High" "Medium" "Low" where in I need to sort it in such a way that I need Critical to be displayed on the top and next High , Medium and Low follows.

View 1 Replies

Flex :: Specify Size For An Arraycollection?

Mar 12, 2010

Context:

I use an ArrayCollection object as follows:

1) Number of elements is fixed.

2) Elements are inserted at a given position, based on some order.

Can I set the max size of the ArrayCollection? Will fixing the size improve the performance, as elements keep getting inserted into this collection?

View 1 Replies

Flex :: Use ArrayCollection In Flash CS5?

Dec 2, 2010

is there any way to use ArrayCollection (from mx.collections.*) in Flash CS3/4/5? How?

View 2 Replies

Flex :: ArrayCollection GetItemIndex Always -1

Mar 1, 2011

I have an ArrayCollection with data; a trace of random index of this using

[code]...

View 2 Replies

Flex :: Create Arraycollection With Different Name?

May 14, 2011

I would like to create a new AC instance with a dynamic variable which is nca1, nca2, etc. Without define using hardcode variable name, it is possible to do that in a loop?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved