flex-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marcus Wilkinson (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (FLEX-34455) Cannot change the headerRenderer on a spark GridColumn
Date Wed, 06 Aug 2014 14:23:12 GMT

    [ https://issues.apache.org/jira/browse/FLEX-34455?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14087705#comment-14087705
] 

Marcus Wilkinson edited comment on FLEX-34455 at 8/6/14 2:21 PM:
-----------------------------------------------------------------

For those who are interested I have introduced a workaround in my custom subclass of MyGridColumn.set
headerRenderer

{code}
public function set headerRenderer(value:IFactory):void
{
	if (_headerRenderer == value)
		return;
	_headerRenderer = value;

	if (grid)
		grid.invalidateDisplayList();

	//custom hack follows:
	if (grid) {
		var headerGroup:GridColumnHeaderGroup = GridColumnHeaderGroup(grid.dataGrid.columnHeaderGroup);
		var view:Group;
		//adapted from GridColumnHeaderGroup.getColumnHeaderViewAtIndex
		const ghl:GridHeaderLayout = headerGroup.layout as GridHeaderLayout;
		if (ghl.leftGridColumnHeaderView && (columnIndex < grid.dataGrid.lockedColumnCount))
{
			view = ghl.leftGridColumnHeaderView;
		} else {
			view = ghl.centerGridColumnHeaderView;
		}
		//end of adaption
		GridHeaderViewLayout(view.layout).clearVirtualLayoutCache();
	}
	dispatchChangeEvent("headerRendererChanged");
}

{code}


was (Author: marcus_sparkus):
For those who are interested I have introduced a workaround in my custom subclass of MyGridColumn.set
headerRenderer

{code}
public function set headerRenderer(value:IFactory):void
{
	if (_headerRenderer == value)
		return;
	_headerRenderer = value;
	invalidateGrid();
	if (grid)
		grid.invalidateDisplayList();

	//custom hack follows:
	if (grid) {
		var headerGroup:GridColumnHeaderGroup = GridColumnHeaderGroup(grid.dataGrid.columnHeaderGroup);
		var view:Group;
		//adapted from GridColumnHeaderGroup.getColumnHeaderViewAtIndex
		const ghl:GridHeaderLayout = headerGroup.layout as GridHeaderLayout;
		if (ghl.leftGridColumnHeaderView && (columnIndex < grid.dataGrid.lockedColumnCount))
{
			view = ghl.leftGridColumnHeaderView;
		} else {
			view = ghl.centerGridColumnHeaderView;
		}
		//end of adaption
		GridHeaderViewLayout(view.layout).clearVirtualLayoutCache();
	}
	dispatchChangeEvent("headerRendererChanged");
}

{code}

> Cannot change the headerRenderer on a spark GridColumn
> ------------------------------------------------------
>
>                 Key: FLEX-34455
>                 URL: https://issues.apache.org/jira/browse/FLEX-34455
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Spark: DataGrid, Spark: Grid
>    Affects Versions: Apache Flex 4.12.1
>            Reporter: Marcus Wilkinson
>         Attachments: _HeaderRenderer.fxp
>
>
> Re-assigning the headerRenderer property at runtime has no effect. This is the case for
both GridColumn.headerRenderer and GridColumnHeaderGroup.headerRenderer
> Please open and run the attached example



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message