Hi all, I'm still a noob at flex but this looks a bit strange to me.
I've been trying to hide a button renderer in a DataGrid but it just wouldn't hide. I've been setting visible inside the mxml and also in the the class that extends buttonbut it just wouldn't hide. I then overloaded the visible property set/get and traced what was setting the property to true and found that inside DataGridBase.as the function setupColumnItemRenderer always sets visible of the renderes to true.
|protected function setupColumnItemRenderer(c:DataGridColumn, contentHolder:ListBaseContentHolder,|
rowNum:int, colNum:int, data:Object, uid:String):IListItemRenderer
var listItems:Array = contentHolder.listItems;
item = listItems[rowNum][colNum];
if (!item || itemToUID(item.data) != uid
|| columnMap[item.name] != c)
item = createColumnItemRenderer(c, false, data);
if (item == null)
if (item.parent != contentHolder)
// a space is used if no data so text widgets get some default size
columnMap[item.name] = c;
listItems[rowNum][colNum] = item;
//[Matt] moved from inside the block above to outside because
//the item definitely exists at this point, and always needs
//its data refreshed
rowData = DataGridListData(makeListData(data, uid, rowNum, c.colNum, c));
rowMap[item.name] = rowData;
if (item is IDropInListItemRenderer)
IDropInListItemRenderer(item).listData = data ? rowData : null;
item.data = data;
item.visible = true;
if (uid && colNum == 0)
contentHolder.visibleData[uid] = item;
Why does it do this? Shouldn't it respect the visible property already set for the renderer in mxml and not force it to true on init?
Renderers use the visible property for recycling. Invisible renderers are not supported. The hit detection logic would find it the cell it belongs to even if it was invisible. You can set alpha=0, but it won't stop the hit detection logic.
Why are you trying to hide a renderer?
Flex SDK Developer
Adobe Systems Inc.
I have a button that exports data when clicked, but is only present if that row has export data assigned to it via another process. This is also a FlexLib TreeGrid so the "Branches" don't have buttons but some of the Leaves do.
OK cool, I can use the alpha property to get what I want. Thanks!