wiln / flexlib

Automatically exported from code.google.com/p/flexlib
0 stars 0 forks source link

function isLastItem #365

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. i use the treeGrid component

2. in the isLastItem function i removed the comment to this line:
var data : Object = IList( dataProvider ).getItemAt( rowIndex );
to have a correct drawing of the tree

3. i open the root node of the tree

What is the expected output? What do you see instead?
i expect to see the tree with the line interrupted in the middle of the node if 
the node is the last of his level.
i receive an error:
RangeError: Index '1' specified is out of bounds.

can anyone solve my problem?Thanks,Lorenzo

Original issue reported on code.google.com by lorenzo....@outlook.com on 31 Aug 2011 at 8:54

GoogleCodeExporter commented 9 years ago
I resolved the problem.I changed:
  var dati:IList=IList( dataProvider);
  //var data= IList( dataProvider ).getItemAt( rowIndex );

with
  var dati:IList=IList( _displayedModel);
  //var data= IList( dataProvider ).getItemAt( rowIndex );

and i commented some lines in the updateDisplayList function 
ofTreeGridItemRenderer.as:
for( var i : int = 0; i < _listData.depth - 1; i++ )
{
  var currentx : Number = 5 + i * _listData.indentationGap;
  //trunk.graphics.moveTo(currentx + (disclosureIcon.width / 2), 0 - _listData.trunkOffsetTop );
  //trunk.graphics.lineTo(currentx + (disclosureIcon.width / 2), this.height   +_listData.trunkOffsetBottom);           
}

Now i can draw a tree like this:
root
  |_b
     |_c
     |_d
     |_e

Original comment by lorenzo....@outlook.com on 31 Aug 2011 at 10:33