Ask a Question related to Macromedia Flex General Discussion, Design and Development.
-
nrutter #1
Sort Array in datagrid
How do you sort an array in your datagrid? I always want to be able to sort my
array by an instance number. If you add a new instance I want it to resort the
array. For example if I ad a product to instance one then add an instance to
instance two...then go back and add one to the first instance it would be
ordered like this..... 1 , 2 , 1. I always want it to sort like this 1 , 1, 2.
How do I do this?
nrutter Guest
-
Sort Array
Hi Can anyone give me a pointer on sorting this array below #curr.getRateCurrencyCode()# (lowest to highest values) <cfloop from ='1' to... -
sort array by key
Hi, What I want is simple, but I can't figure it out at the moment. Let's say this is an array names $matches: Array ( => Array ( -
Sort a 2D array
Hello, I have a 2D array which I would like to sort. I take a simple example: $tab = 'toto';$tab = 'toto'; $tab = 'aaaa';$tab = 'titi'; $tab... -
sort w/o using an array
I am trying to figure out if there is a way to do a sort that doesn't involve putting an entire file in memory. This kind of thing is available in... -
Help me sort a two - d array
I need help sorting a multidimensional array. I have an array myarray(column_no, row_no) it has 5 columns for this example I have used 4 rows... -
javamonjoe #2
Re: Sort Array in datagrid
Is there a problem with the sortCompareFunction attribute of the column? If you require a custom sort routine you may define one there.
javamonjoe Guest
-
nrutter #3
Re: Sort Array in datagrid
Okay so how do I use that function to sort my column? That is what I don't understand how to do?
nrutter Guest
-
javamonjoe #4
Re: Sort Array in datagrid
Use the sort object to provide the initial sort. Other sorts may be chosen by the user at runtime.
javamonjoe Guest
-
javamonjoe #5
Re: Sort Array in datagrid
I'm sorry, but I wasn't clear. Use the sort object to sort your dataProvider for the initial sort.
javamonjoe Guest
-
nrutter #6
Re: Sort Array in datagrid
Can you show an example of this I still don't understand what you mean?
nrutter Guest
-
javamonjoe #7
Re: Sort Array in datagrid
Something like the following:
var myData : ArrayCollection = getMyData();
var sort:Sort = new Sort();
myData.sort = sort;
myData.refresh();
myDataGrid.dataProvider = myData;
You will have to manipulate the sort object and its fields to satisfy the
particular needs you have, but that is the basic idea.
javamonjoe Guest
-
nrutter #8
Re: Sort Array in datagrid
So where in there do you actually specify what column you are sorting by?
nrutter Guest
-
javamonjoe #9
Re: Sort Array in datagrid
Check out the sort object and use the SortFields object in tandem. Time to do a little reading now.
javamonjoe Guest
-
nrutter #10
Re: Sort Array in datagrid
I have been reading all day on how to do this. Thanks.
nrutter Guest
-
bitwyse #11
Re: Sort Array in datagrid
Here is a bit of code that might help . . .
var sortFields : Sort = new Sort();
var sortField1 : SortField = new SortField( "sfWeekEndingDate", true,
true, false );
var sortField2 : SortField = new SortField( "sfDateSubmitted", true,
false, false );
sortFields.fields = [ sortField1, sortField2 ];
model.asUpdates.arrayOfASUpdateVOs.sort = sortFields;
model.asUpdates.arrayOfASUpdateVOs.refresh();
bitwyse Guest



Reply With Quote

