Posts Tagged ‘flex compiler’

 

Posted by : Bigyan Basnet on | Related Categories: Flex

I was having problems extending the DataGrid component. Whenever I created a custom DataGrid component by subclassing DataGrid, I ran into problems with

   <mx:columns>
   </mx:Columns>

The compiler complaining that:

Could not resolve <mx:columns> to a component implementation

Googling it, instead of solutions, I ran into people having the same problem and not coming up with a solution. Basically, the after subclassing DataGrid, using ‘mx:columns’ seems to get the compiler searching for a component implementation rather than the ‘columns’ property. Both with extending DataGrid through MXML and ActionScript.

Finally, I found some code where a guy was successfully sub-classing a Datagrid and using it in mxml and this worked:

At the top use xmlns=”*” to reference everything:

    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*">

Then don’t reference your custom datagrid namespace or the mx namespace when referencing a datagrid’s columns property. For ‘DataGridColumn’ using ‘mx’ namesspace works fine.

<YourCustomDataGrid.........>
  .................
   <columns>
          .............
   </columns>




Tags: > > > > > >

August 15, 2007 at 6:23 pm by Bigyan Basnet