Exactly right. Thanks. I think when I read the description of unshift(),
where it says "adds one or more elements...", I subconsciously thought
ARRAY. So the following code upon a headerrelease event works fine, just
in case someone else has a similar mission (I use this in combination
with the CTL key):

             var cols : Array = dgItems.columns;
      cols.unshift(cols.splice(event.columnIndex,1)[0]);
      dgItems.columns = cols;

Danke...


--- In flexcoders@yahoogroups.com, "Ralf Bokelberg" <[EMAIL PROTECTED]>
wrote:
>
> As you said, splice returns an Array and not the actual column.
> Try columns.push( splicedThings[ 0 ]);
> Cheers,
> Ralf.
>
> On 5/2/07, iko_knyphausen [EMAIL PROTECTED] wrote:
> >
> > Hi,
> >
> > trying to change the sequence of datagrid columns by working on the
> > datagrid.columns array. I understand from previous posts that one
should
> > copy the array, do the array manipulations, then assign it back to
the
> > columns property. So far so good. I came across one curiousity that
I cannot
> > explain:
> >
> > 1. First I am splicing a column that gets deleted at the current
> > position. The splice function should return an array of elements
deleted.
> > 2. Then I take this array and try insert it using unshift, splice or
> > push. No good. I also tried to first assign the "cut" element to a
interim
> > var of type DataGridColumn. Still no good.
> >
> > The whole thing works fine, if I make a copy of the column before it
gets
> > "cut".... and take this as argument in a unshift, splice, or push
....
> >
> > Thx
> >
> >
> >
>
>
>
> --
> Ralf Bokelberg [EMAIL PROTECTED]
> Flex & Flash Consultant based in Cologne/Germany
> Phone +49 (0) 221 530 15 35
>


Reply via email to