Open GoogleCodeExporter opened 8 years ago
I've done some more investigating on this. It seems that what happens is when
you do
the drag and drop TreeGridItemRenderer's set listData function gets called:
public function set listData( value : BaseListData ) : void
The argument that ends up being passed in during the drag is an instance of
DataGridListData, but TreeGridItemRenderer casts it to a TreeGridListData
instance
which causes the chain of errors in the original report.
You cannot just do a simple if (value is/instanceof TreeGridListData) do cast,
because then you get a bunch of other errors later on. One workaround that
seems to
be working for me right now is to just have code like so:
public function set listData( value : BaseListData ) : void
{
if( !value )
return;
if ( value is TreeGridListData) {
_listData = TreeGridListData( value );
} else if (value is DataGridListData) {
// this is true when we're in a drag event
var dataGridListData : DataGridListData = DataGridListData(value);
_listData = new TreeGridListData(dataGridListData.label,
dataGridListData.dataField,
dataGridListData.columnIndex,
dataGridListData.uid,
dataGridListData.owner,
dataGridListData.rowIndex);
}
}
If you do this you then also need to change in the TreeGridItemRenderer, the
updateDisplayList method, at around line 314:
original
if(disclosureIcon.visible)
{
//vertical item line (separated in 2 part, top of the icon and bottom of the icon)
trunk.graphics.moveTo(startx - (disclosureIcon.width / 2), 0 -
_listData.trunkOffsetTop );
trunk.graphics.lineTo(startx - (disclosureIcon.width / 2), disclosureIcon.y );
new
if(disclosureIcon && disclosureIcon.visible)
{
//vertical item line (separated in 2 part, top of the icon and bottom of the icon)
trunk.graphics.moveTo(startx - (disclosureIcon.width / 2), 0 -
_listData.trunkOffsetTop );
trunk.graphics.lineTo(startx - (disclosureIcon.width / 2), disclosureIcon.y );
since this change results in disclosureIcon potentially being null.
This is not a good fix, but is a workaround that seems to work for my purposes
(TBD).
I am not sure of the ramifications of this change.
Original comment by jerry....@gmail.com
on 6 Apr 2007 at 6:56
Thanks for the detailed report. Assigning to Yaniv.
Original comment by darron.schall
on 7 Apr 2007 at 12:05
Original comment by dmcc...@gmail.com
on 26 Dec 2007 at 11:45
Are there any plans
on fixing this in the near future?
Original comment by pietro....@gmail.com
on 17 Nov 2008 at 4:54
Original issue reported on code.google.com by
jerry....@gmail.com
on 6 Apr 2007 at 4:06