You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by "Jeremy Wischusen (JIRA)" <ji...@apache.org> on 2013/04/30 14:04:15 UTC
[jira] [Commented] (FLEX-17760) datagrid datatip "[object Object]"
for null/unset items
[ https://issues.apache.org/jira/browse/FLEX-17760?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13645517#comment-13645517 ]
Jeremy Wischusen commented on FLEX-17760:
-----------------------------------------
Still occurring using SDK 4.9.1 on Mac OS X 10.7.5 .
> datagrid datatip "[object Object]" for null/unset items
> -------------------------------------------------------
>
> Key: FLEX-17760
> URL: https://issues.apache.org/jira/browse/FLEX-17760
> Project: Apache Flex
> Issue Type: Bug
> Components: mx: DataGrid
> Affects Versions: Adobe Flex SDK 3.0 (Release)
> Environment: Affected OS(s): All OS Platforms
> Language Found: English
> Reporter: Adobe JIRA
> Labels: easytest
>
> Steps to reproduce:
> 1. DataGrid with dataProvider where some column properties are null or unset
> 2. set showDataTips="true" for that column
> *see example code below*
> Actual Results: datatip "[object Object]" on those fields
> Expected Results: no datatip (like for "" fields) or empty datatip when a property is null or unset.
> The bug occurs with both Flex 2.0.1 and Flex 3.0 SDK.
> Explicitly setting dataTipField does not change it and a label function would be provided the entire row data without being passed the dataField.
> Workaround: as an object result of a http service contains null properties for emty nodes/attributes one must
> either manually replace null with "" in the data or use a custom item renderer (e.g. based upon a Label).
> Supposed Reason:
> DataGridColumn.itemToDataTip gets passed the row data; when the (data(tip))field is null or unset
> data[field] != null is false and data = data[field] is not executed, thus data.toString() is performed on the row data.
> There should be a check somewhere to show no datatip at all in this case.
> Example code:
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
> <mx:Script>
> <![CDATA[
> private const gridData: Array = [
> { desc: "with item set.", item: "hello" },
> { desc: "with empty string", item: "" },
> { desc: "with null item", item: null },
> { desc: "without item property" }
> ];
> ]]
> >
> </mx:Script>
> <!-- expected behavior: no datatip when datatip field is null or unset -->
> <!-- actual datatip for null and unset properties: "[object Object]" -->
> <mx:DataGrid dataProvider="{gridData}">
> <mx:columns>
> <mx:DataGridColumn dataField="desc" headerText="Description" showDataTips="true"/>
> <mx:DataGridColumn dataField="item" headerText="Item+Datatip" showDataTips="true"/>
> <mx:DataGridColumn dataField="item" dataTipField="item" headerText="+dataTipField" showDataTips="true"/>
> </mx:columns>
> </mx:DataGrid>
> </mx:Application>
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira