On 15 Mar 2006, at 17:38, Steve Webster wrote:

James,

Thanks for the reply. I was about to have a hernia. I've snooped through as much of this component as I'm willing to bare.

If you mean this:

tree.addEventListener('itemRollOver', treeListener);
tree.addEventListener('itemRollOut', treeListener);

treeListener.itemRollOver = function(evt:Object)
{
   evt.target.setStyle("useRollOver", false);
}
treeListener.itemRollOut = function(evt:Object)
{
   evt.target.setStyle("useRollOver", true);
}

It really doesn't work very well. The custom event handler responds after the default behaviour has been triggered.

Just a quick thought: what about turning the above on its head. Disable useRollOver and only enable when rolling over items that are enabled? Probably won't work, but its worth a try!

How can it be this complex to just stop the rollover for disabled elements :'(

You'll probably have to resort to prototype hacking, which I had to do with the Tree component to prevent nodes being closed depending on certain conditions.

Something like this:

DataGrid.prototype.oldOnRowRollOver = DataGrid.prototype.onRowRollOver;
DataGrid.prototype.onRowRollOver = function(rowIndex : Number) {
        if (this.rows[rowIndex].item.enabled === false) return;
        return this.oldOnRowRollOver.apply(this, arguments);
}

You can also do the same with onRowPress to prevent disabled rows from being selected.

--
Steve Webster
Head of Development

Featurecreep Ltd.
http://www.featurecreep.com
14 Orchard Street, Bristol, BS1 5EH
0117 905 5047


_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to