Actionscript 3 :: Flex List Sorting Animation?

Jun 25, 2011

I have a list which displays votes cast on things in a descending order (=the dataprovider has a sort assigned). The elements have variable height, but there are not so many elements, so i do not need to use a virtual layout

My problem is that this list needs to be updated real-time and i want to make this happen with a nice animation. (e.g. if an item overtakes another by votes, then they swap places.) Anyone knows how to make this animation with Flex 4.5 (spark list)? Do i need to write a custom layout?

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Linked List Sorting Best Algorithm?

Dec 26, 2009

I know there isn't a built-in linked list in AS3, but one can easily write his own. However, I found it difficult to come up with a good solution for sorting such list.If you didn't know, linked list is a chain of "cell" objects, where each object has a reference to the next object, typically you can write it like this:

Cell1.next = Cell2;
Cell2.next = Cell3;
CellN.next = null;

(Circular linked list and bidi linked lists are out of the scope of my problem, for now at least).

I looked into other languages that do have linked lists or even standard libraries for them, however, I don't seem to be able to either port any of their solutions, or, some of them, if ported to AS3 would not be workable (since they use recursion) or would otherwise have huge overhead because of lots of method calls etc.

I think, I'm focused on 2 possible algorithms: Merge sort and Insertion sort. These two seem to be most applicable to AS3. However, I may be wrong - so, please fill free to correct me.

View 5 Replies

Actionscript 3 :: Create A Combobox Or Listbox That Can Display A List Of Locations Sorting Them Either Alphabetically Or By The Category?

Feb 12, 2010

I have xml data that I can load into my flex app; however, I need to sort it by node.I'm trying to create a combobox or listbox that can display a list of locations sorting them either alphabetically or by the category they are in...

I can't get my head around how to format the xml or how to code the flash file to sort according to location name alphabetically and then press a button that will sort it by category 1st and second by name alphabetically.

Should I format the xml like this:

<POIs>
<location>
<name>Barbaras Bagels</name>

[code].....

View 1 Replies

Flash - Sorting Display Objects By Their Display List Depth

Aug 5, 2011

I have a list containing display objects from throughout the application (insertion order). I want to process the list either top-down (parent, child) or bottom up (child, parent). The only requirement is that either a parent is processed before any child or vice versa a child before its parent. What is a good approach? This question is not about sorting a list. It's about retrieving the depth of a particular display object.

Example
Display list:
A (root)
B1
C1
C2
D1
B2
......

My list:
list = [E1, F4, A, B2, B1, C3, ..., N9, N8]

Bottom-up:
N9, N8, F4, E1, C3, B2, B1, A

Top-down:
A, B2, B1, C3, E1, F4, N9, N8
Does not matter if N9 before N8 or N8 before N9. Important is that any N is before M (first run) or any M before its children N* (second run).

View 2 Replies

Flex :: Datagrid - Flex AdavcedDatagrid Sorting Is Case-sensitive

Jul 27, 2010

I have several datagrids with changing columns. For the text fields the datagrid's sort function neems to be making a case sensitive compare. eg. the following list sorted would look like this apples strawberries Autos Autos should be with apples but since the capital A is counted differently all capital letters come after. I've found a lot of information on setting a CASEINSENSITIVE flag, but I can't figure out where to do this. The best solution would be one where I can override the default behavior to be case insensitive for all my datagrids and all my compare functions.

View 3 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 :: Flex S:datagrid Sorting Doesn't Seem To Work?

Feb 18, 2012

I'm using Flashbuilder 4.6 and can't get sorting of columns in my s:DataGrid to work, clicking on the columns does nothing. Can anyone suggest what is wrong?

[Code]...

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 :: Sorting Dates In Adg

Apr 4, 2011

I have an advancedDataGrid and I would like to sort the adg according one AdvancedDataGridColumn(studyDate) which use strings in format DD/MM /YYYY(I receive like this from the server):But i find another problem, I need to sort the columns of the adg the first time it displays so I used the following function but It doesn't sort from the recent day to old one, I do not know what I can I do cause I set sort.descending= true, any ideas?[code]

View 1 Replies

Flex :: Sorting - Get Value In ComboBox

Sep 26, 2011

I have a one comboBox that I fill as:
for (var key:String in values) {
conns.addItem(key);
}

After that I sorted my ComboBox as:
private function sortConnection():void {
var dataSortField:SortField = new SortField();
dataSortField.name = "data";
dataSortField.numeric = true;
var numericDataSort:Sort = new Sort();
numericDataSort.fields = [dataSortField];
conns.sort = numericDataSort;
conns.refresh();
}

And on finish I want to select item on my specific value in ComboBox. How can I do that? I try:
for (var ii:Number=0; ii<combo.rowCount; ii++) {
var item:String = combo.getChildAt(ii);
if (item == name) {
index = ii;
}}
But does not work. I do not know where I made mistake, and how I can select on specific item in my combobox.

View 2 Replies

Flex :: 4.1: <mx:List> Had RowCount Properly For The Limit The Displayed Items. <s:List> Doesn't

Aug 11, 2010

I'm using flex 4.1 to write an application. i read in the documents that has the rowCount property to set how many items to display. the does not have that property. how can I limit the list to display 3 items ?

View 3 Replies

Flex :: MX List ItemRollOver Event Equivalent On A Spark List Control?

May 26, 2011

Flex 3 List control had a itemRollOver event. Flex 4 List doesn't have it. Is there an equivalent or a workaround for this issue?

View 2 Replies

Flex :: Customize The Sorting In Datagrid?

Jul 2, 2009

I have a column with 4 fields named : a> Main, b> Forward c> Back d> Link, if I use pre-defined sorting of datagrid with the column names which will be alphabetically, then the order is c>Back b>Forward d> Link a> Main. But, I do not want to sort based on the alphabets. I prefer to sort by names of the column fields. i.e. somehow give priority to each individual column field names. Like pre-define my own order.

View 2 Replies

XML :: Flex Sorting Of ListCollection Sub Elements

Aug 13, 2009

In a Flex webapp, is there an easy way to go about applying a sort to the children of an XML element, based on the children's attributes? Example follows below:

XMLListCollection:
<a anotherProp="ABCDE">
<e prop="AB">1</element>
<e prop="BC">2</element>
</a><a anotherProp="FGEH">
<e prop="HF">3</element>
<e prop="AD">4</element>
<e prop="AC">5</element></a>

I would like to sort the <e> elements, within each <a> element separately, according to their "prop" attribute. My code for generating the array containing the <a> elements is along the lines of:
for each(var node:XML in initialInput:XMLListCollection){
if(node.localName()=="a"){
//I was hoping to be able to sort the <e> children of the node variable here
xmlListCollectionVar.addItem(node);
}}

At the end I would like the <a>'s to remain in their defined order, but their <e> children to be sorted based on the "prop" attribute. So far if I try:
node.children().sort=someSortVar
Where someSortVar has its fields set to:
SortFields("e.@prop",...)
I get an exception about a null value. Any way to convert the children list to XMLListCollection, sort it and integrate it back into the node variable?

View 3 Replies

Flex In DataGrid Default Sorting?

Dec 12, 2009

I have a datagrid with data like this:

[Code]...

View 1 Replies

Flex :: Sorting In Advanced Datagrid?

Jan 18, 2010

I have a Advanced Datagrid with sorting. I think it is string sorting by default. But i need the sorting in number. How can i achieve the number sorting.for example: i have row numbers like 1 to 100 . i need number sorting like 1,10,100.

View 2 Replies

Actionscript 3 :: Sorting In AdvancedDatagrid In Flex 3

Aug 25, 2010

I am using in-built sort functionality provided by AdvancedDatagrid.I have multiple columns and suppose I have 10 rows. All 10 rows have the same data in one column.If I sort on that column, then it sorts and the data in other columns which is different is also being sorted (reshuffled).My requirement is if I am sorting on a column with same data, it should not sort the data in other columns.To understand it better, check the link menioned below URL...In the above link mentioned, if you click on region column, other columns like territory or actual will change the values i.e. the rows gets reshuffled.This should not happen as we are sorting on a column which has same values. Does anybody know how this can be handled in Flex 3 for AdvancedDataGrid.

View 1 Replies

Flex :: 3: Scrolling Of List Items With In A List Via Scroll Wheel

Dec 31, 2009

Here is a snip from within my code:

[Code]...

The 'recommendations' dataProvider is an ArrayCollection of String, which are generally sentences about as long as this one. By setting the variableRowHeight and wordWrap properties as shown, if a sentence is too long to fit on a single line, everything works fine- the row expands and the messages show on two lines, or occasionally three.

The space allocated for this panel within the entire canvas means if the total text size of 'recommendations' exceeds six lines, I need for the entire list scroll. This is also working just fine. The trouble is when using the mouse wheel to do the scrolling- Flex scrolls both the entire list and the single item where the mouse is hovering. Often this results in only the second half of a sentence being visible. Non-programmer friends I have asked to look at this noticed this, and tell me it as a problem. If a user does not notice the dual scrolling, and sees only a fragment of a sentence, it will be perceived as an error in the application.

[Code]....

View 1 Replies

Flex :: Make List Content Dependant On Selection In Another List?

Jul 6, 2011

When a user selects a category from the first drop down box then i want the 2nd drop down to be updated based on the selection of the first drop down. I have created multiple ArrayCollections whose names are set to the "data" values of the first drop down, for instance:

[Bindable]
public var countries:ArrayCollection = new ArrayCollection([
{label:"USA",data:"USA"},

[code].....

View 2 Replies

Actionscript 3 :: Flex - List Selected Entire List By Default?

Aug 31, 2011

I am currently working on a project in Flex and I am having a hard time having a list's contents ALL be selected by default. Wondering how to do this.

<mx:List id="list" dataProvider="{dp}" allowMultipleSelection="true"/>

I'm just trying to have the list all selected.

View 2 Replies

AS :: Flex - Sorting ArrayCollection By Date: YYYY-MM-DD?

Dec 8, 2009

I have an ArrayCollection of Objects. Each Object has the following keys/values:

{date: 2009-12-01, visits=13555, bouceRate=45}
{date: 2009-12-05, visits=46955, bouceRate=45}
{date: 2009-12-06, visits=13685, bouceRate=45}

[code].......

View 3 Replies

Flex :: Default Sorting Within OLAPDataGrid Component

Oct 7, 2010

I'm trying to provide some default sorting within the OLAPDataGrid component in Flex. There appears to be a dataCompareFunction on OLAPAttribute, but nothing I do seems to actually trigger calls to that method. Any suggestions around using this method or any others to provide sorting of the dimensions on OLAPDataGrid?

View 2 Replies

Actionscript 3 :: Flex Nested ArrayCollections Sorting?

Nov 26, 2010

I have an ArrayCollection nested in another one. I need to sort the child collection by a field.
I tried the following code. It works fine for the parent collection, but does nothing for the child one.

// The Data
public class Data
{
public var value:String;
public var otherValue:String;
public var childrenData:ArrayCollection; // An array collection containing Data objects.
}

[Code]...

View 1 Replies

Actionscript :: Sorting Columns In A Flex Datagrid

Oct 14, 2011

The datagrid gets its data from a back end database which has records like

[Code]....

I get errors like 1061: Call to a possibly undefined method refresh through a reference with static type mx.controls:DataGrid. for myRecords.refresh(); and Access of possibly undefined property sort through a reference with static type mx.controls:DataGrid. for myRecords.sort

View 1 Replies

Flex :: Sorting DatagridColumn According To FileType Extensions?

Oct 28, 2011

I have a DatagridColumn in flex with two names, TYPE and NAME. Now, when I am sorting a datagridcolumn, TYPE, it sorts the type using sortcomparefunction and gives the result which contains grouped and sorted order of elements. Ex. if I sort for type I get elements in pdf, doc, ppt in grouped order, but they are internally not sorted, ex: for the pdf part, I have elements such as:
TYPE NAME
pdf A1.pdf
pdf X2.pdf
pdf B1.pdf

Here the filetypes are sorted, but for a particular filetype, the elements are not, please notice that B1 occurs after X2, which should be sorted. Is there a way I can sort the second datagridcolumn after sorting the first one according to filetype extensions? I am using sortcomparefunction for sorting the elements according to type , which works fine. The signature is:
private function sortTheTypeColumn(itemA:Object, itemB:Object):int

View 1 Replies

Flex :: Spark List Have Something Similar To ItemsChangeEffect In Mx List?

Jun 28, 2010

I'm trying to animate a list as I delete the top row. All the examples I can find use itemsChangeEffect to bind to the effect, but this property exists only in MX lists, not spark lists.

Any idea how I can get the same effect done in Spark Lists?

I'm trying to remove the top most item in the list with a slight fade out effect before the rest of the items move up to replace the gap.

View 2 Replies

Flex :: AdvancedDataGrid Multi-column Programmatic Sorting?

Jul 30, 2009

I need to to a programmatic multi column sorting on the AdvancedDataGrid.The issue is, currently I am implementing paging on my grid. So, if I sort the data,only the perticular page is being sorted. So,I need to sort the entire list by the column criteria.I tried HeaderRelease event,but I guess it is of no use as I need to make a round trip call to the server to get the sorted data.Is there any way I can implement that.I also need to show the sort markers in the Column headers' right position, indicating the sort numbers and direction.

View 7 Replies

Flex :: Extending DataGridColumn For Custom Sorting Function

Aug 25, 2009

I extended the DataGridColumn because I wanted to include a custom itemToLabel function (to be able to show nested data in the DataGrid. See this question.

Anyways, it also needs a custom sorting function. So I have written the sorting function like so:

private function mySortCompareFunction(obj1:Object, obj2:Object):int{
var currentData1:Object = obj1;
var currentData2:Object = obj2;

[Code].....

Whenever I try to sort the column, I get the error "Error: Find criteria must contain at least one sort field value."

When I debug and step through each step, I see that the first few times, the function is being called correctly, but towards the end, this error occurs.

View 4 Replies

Actionscript 3 :: Sorting Function Not Called In Flex Datagrid?

Oct 11, 2009

I am creating a Datagrid in AS3, and adding a sort function to a column. However, this sort function does never get called. Any ideas?

dg_gruppenUebersicht = new NestedDataGrid;
dg_gruppenUebersicht.sortableColumns = true;
dg_gruppenUebersicht.dataProvider = arrCol_gruppenTnAkt;

[code]....

View 1 Replies

Flex Advance Datagrid Date Column Sorting?

Feb 1, 2010

I'm trying to sort ArrayCollection with following dates, and getting unexpected results.

14-Apr-1980
01-Feb-1975
30-Dec-1977
27-Oct-1968

[Code]...

View 1 Replies







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