[flexcoders] Re: Custom Collection Sorting Challenge

2007-02-28 Thread iko_knyphausen

Duh, was not thinking...forgot creating a new array first...interesting
though that it did not throw an exception...

aSort.fields = new Array();


--- In flexcoders@yahoogroups.com, iko_knyphausen [EMAIL PROTECTED] wrote:


 Hi all,

 more questions on custom collection sorting... I have a
 XMLListCollection dataprovider, which I am sorting using a sort
object.
 The sorting works as expected, when I use the following syntax to
define
 the array of SortFields:

 aSort.fields = [sfSortField, sfLevel];

 However, I would like to assemble the fields array dynamically,
 depending on column position, or what have you, so my first thought
was
 to use the array.push() method to add the individual SortFields, but
 this fails without an exception being thrown...

 i = aSort.fields.push(sfSortField);
 i = aSort.fields.push(sfLevel);

 Any ideas? Thanks





[flexcoders] Re: Custom Collection Sorting Challenge

2007-02-28 Thread Doug Lowder
Are you setting aSort.fields to an Array before calling push()?  Try 
the following before you push the sort fields:

 aSort.fields = [];

--- In flexcoders@yahoogroups.com, iko_knyphausen [EMAIL PROTECTED] wrote:

 
 Hi all,
 
 more questions on custom collection sorting... I have a
 XMLListCollection dataprovider, which I am sorting using a sort 
object.
 The sorting works as expected, when I use the following syntax to 
define
 the array of SortFields:
 
 aSort.fields = [sfSortField, sfLevel];
 
 However, I would like to assemble the fields array dynamically,
 depending on column position, or what have you, so my first 
thought was
 to use the array.push() method to add the individual SortFields, 
but
 this fails without an exception being thrown...
 
 i = aSort.fields.push(sfSortField);
 i = aSort.fields.push(sfLevel);
 
 Any ideas? Thanks