2 Replies Latest reply on Jan 12, 2010 5:35 AM by cannyshammy

    Extending the DataGrid in Flex 4?

    cannyshammy

      Hi Guys,

       

      Simple question really. I want to extend the mx:DataGrid in my Flex 4 project so that I can add some custom drag/drop functionality.

       

      Once I have extended it however im getting the following error:

       

       

      Description Resource Path Location Type

      Could not resolve <mx:columns> to a component implementation. MainView.mxml AudioBookOrganiser/src/uk/co/mikecann/views line 40 Flex Problem

       

       

      My Code:
      <components:DraggableDataGrid width="100%" height="100%" dataProvider="{books}" editable="true" itemEditEnd="{dispatchEvent(new BooksEvent(BooksEvent.PROPERTY_CHANGED));}" dragEnabled="true" dragStart="{dispatchEvent(new BooksEvent(BooksEvent.BOOK_BEGIN_DRAG,event))}">
           <mx:columns>
                <mx:DataGridColumn width="68" headerText="Listened" editable="false" dataField="listened" itemRenderer="uk.co.mikecann.views.renderers.ListenedItemRenderer" />
                <mx:DataGridColumn headerText="Name" dataField="name" editable="false" />
                <mx:DataGridColumn width="50" headerText="Rating" dataField="rating" editable="true"/>
           </mx:columns>
      </components:DraggableDataGrid>
      Any clues?
      Mike
      P.S. Ugggghhh formatting on this forum sucks
        • 1. Re: Extending the DataGrid in Flex 4?
          JeffryHouser Level 4

          As columns is a property on your component [not a class] I bet this would work:

           

          <components:DraggableDataGrid width="100%" height="100%" dataProvider="{books}" editable="true" itemEditEnd="{dispatchEvent(new BooksEvent(BooksEvent.PROPERTY_CHANGED));}" dragEnabled="true" dragStart="{dispatchEvent(new BooksEvent(BooksEvent.BOOK_BEGIN_DRAG,event))}">
               <components:columns>
                    <mx:DataGridColumn width="68" headerText="Listened" editable="false" dataField="listened" itemRenderer="uk.co.mikecann.views.renderers.ListenedItemRenderer" />
                    <mx:DataGridColumn headerText="Name" dataField="name" editable="false" />
                    <mx:DataGridColumn width="50" headerText="Rating" dataField="rating" editable="true"/>
               </components:columns>
          </components:DraggableDataGrid>
          • 2. Re: Extending the DataGrid in Flex 4?
            cannyshammy Level 1

            Cheers mate, that was it, spot on