flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael A. Labriola" <labri...@digitalprimates.net>
Subject RE: XMLListCollection issue
Date Sat, 04 Jan 2014 01:16:41 GMT

Here is my proposed fix in XMLListAdapter:: addItemAt() :

...

if (length > 0) {
  var localLength:uint = source.length();

  //Adjust all indexes by 1
  for ( var i:uint = localLength; i>index; i-- ) {
    source[i] = source[ i - 1 ];
  }
}
 
source[ index ] = item;

...

We may be able to optimize this too. For example, we could check if the incoming node already
has a parent. If it does, then we need to do this work. If it does not, we could use the older
method which is faster.

Mike




Mime
View raw message