flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Mclean <jus...@classsoftware.com>
Subject Datatips not functioning correctly in list and grids
Date Wed, 21 Mar 2012 05:13:59 GMT

The documentation for datatips state "DataTips are tooltips designed to show the text that
is too long for the row."

However currently datatips show up all of the time in mx:AdvancedDataGrid, mx:DataGrid, mx:List
and s:DataGrid.

The code is implemented correctly in the ListItemRender (and DataGridItemRenderer and AdvancedDataGridItemRenderer
etc classes) the issue is that the dataTipField has a default of "label" which means tool
tips show for all items.

 Here's the relevant code from the ADG item renderer:

                if (!(_data is AdvancedDataGridColumn) && (textWidth > width 
                    || column.dataTipFunction || column.dataTipField 
                    || dg.dataTipFunction || dg.dataTipField))
                    toolTip = column.itemToDataTip(_data);
                    toolTip = null;

As dg.dataTipField is going to be non null if ignores the textWidth > width check. It's
similar with the datagrid and the list renderers.

A work around for the mx classes is to do bind or set dataTipField to null, this is a bit
ugly and I think it would be better to change the default value of dataTipField to null (or
perhaps add a check of && dataTipField != labelField). I've not been able to work
out a work around for the s:DataGrid yet.

Anyone have any more info (or an opinion) on this? There's no existing JIRA issue in the Adobe
bug base that I can find.

Note that s:List doesn't have an issue as it doesn't support dataTips at all :-(

View raw message