0 Replies Latest reply on Feb 7, 2008 9:13 AM by bitwyse

    Double Click Vs. Change events in datagrid

    bitwyse Level 1
      Hi All, I'm hoping someone can see something I'm missing here . I use the Cairngorm framework for a project that I am developing. I have the basic shell of the application working quite well. I am trying to add some details to the code now and am having some strange results. I have a page that displays a datagrid . My datagrid has both a double click handler as well as a change handler. My double click handler first calls the change handler in order to fetch some data from a web service behind the scenes. The problem is this. When I load the datagrid and double click on an entry the resulting data doesn't show up. However, when I single click an entry in the datagrid then double click it, the resulting data shows up. That doesn't make sense to me. Below is the code for the data grid and the change and doubleclic handlers. Any ideas would be greatly appreciated.

      <psc:MyDataGrid id="dataGridProjects"
      doubleClick="viewDetailHandler( event )"
      MyViewCurrentEvent="viewDetailHandler( event )"
      MyEditCurrentEvent="editCurrentHandler( event )"
      MyDeleteCurrentEvent="viewDetailHandler( event )">
      <mx:DataGridColumn headerText="Prj. #" dataField="projectID" width="80"/>
      <mx:DataGridColumn headerText="Prj. Name" dataField="projectName" width="250"/>
      <mx:DataGridColumn headerText="Status" dataField="projectStatus" width="50"/>
      <mx:DataGridColumn headerText="Start" dataField="projectStartDate" width="80" sortCompareFunction="compareProjectStartDates"/>
      <mx:DataGridColumn headerText="Comp. #" dataField="projectCompanyNumber" width="60"/>
      <mx:DataGridColumn headerText="Comp. Name" dataField="projectCompanyName" width="250"/>
      <mx:DataGridColumn width="20" itemRenderer="com.psc.eis.view.MyDGViewRenderer"/>
      <mx:DataGridColumn width="20" itemRenderer="com.psc.eis.view.MyDGEditRenderer"/>
      <mx:DataGridColumn width="20" itemRenderer="com.psc.eis.view.MyDGDeleteRenderer"/>

      private function getProjectInformation() : void
      if( model.getDeliverables.arrayOfDeliverableVOs )

      if( model.getTasks.arrayOfTaskVOs )

      if( model.getMailInDocuments.arrayOfMailInDocumentVOs )

      var event : GetProjectDetailsEvent = new GetProjectDetailsEvent();
      event.data = dataGridProjects.selectedItem;
      CairngormEventDispatcher.getInstance().dispatchEvent( event );

      var event2 : GetMailInDocumentsEvent = new GetMailInDocumentsEvent();
      event2.data = dataGridProjects.selectedItem;
      CairngormEventDispatcher.getInstance().dispatchEvent( event2 );

      public function viewDetailHandler( event:Object ) : void
      model.workflowState = ModelLocator.VIEWING_PROJECT_DETAIL;