House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  Adobe Flex

Set DataGrid headerRenderer dynamically

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Hi
Brian McCairn
05/14/09 04:07 A
> Hi
Brian McCairn
05/18/09 09:51 A
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Brian McCairn
05/14/2009 04:07 AM

Hi Flex newbie so be gentle. I've got a function to create a new colummn in a grid ...              private function addBlankDataGridColumn(dataField:String):void             {                 var dgc:DataGridColumn = new DataGridColumn(dataField);                 dgc.headerText="hi2";                 dgc.headerRenderer="VDGHeader";                 var cols:Array = musicDatagrid.columns;                 cols.push(dgc);                 musicDatagrid.columns = cols;             } This works fine apart from the line dgc.headerRenderer="VDGHeader"; I can set the headerRenderer="VDGHeader" as a parameter in predefined columns and it works fine, but in the function above it causes the following error 1067: Implicit coercion of a value of type String to an unrelated type mx.core:IFactory. I've tried dgc.setHeaderRenderer("VDGHeader"); but no luck. Can you set the headerRenderer dynamically? Thanks Brian

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Brian McCairn
05/18/2009 09:51 AM

> Hi > > Flex newbie so be gentle. > > I've got a function to create a new colummn in a grid ... >              > private function addBlankDataGridColumn(dataField:String):void              > {                  > var dgc:DataGridColumn = new DataGridColumn(dataField);                  > dgc.headerText="hi2";                  > dgc.headerRenderer="VDGHeader";                  > var cols:Array = musicDatagrid.columns;                  > cols.push(dgc);                  > musicDatagrid.columns = cols;              ----- Excess quoted text cut - see Original Post for more ----- I found the following seems to do the trick dgc.headerRenderer= new ClassFactory(VDGHeader);


<< Previous Thread Today's Threads Next Thread >>

Search flex

March 19, 2010

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
   1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31