2 Replies Latest reply on May 15, 2008 10:17 AM by nrutter

    Datagrid item renderer delete button

    nrutter
      I have a datagrid with an item renderer. In the item renderer is a delete button img. Onclick it will remove the item from the datagrid with the exception of the first item. I am using outer document to call my function but when I do I get an error that says Attempt access of inaccessible method deleteContact through a reference with static type myTitleWindowContact?

      private function deleteContact(event:Event,data:*):void{
      if (contactData.selectedIndex >= 1) {
      caseVO.acCont.removeItemAt(contactData.selectedIndex);
      }
      }

      <mx:DataGrid dataProvider="{model.currentVO.acCont}"
      id="contactData"
      width="651"
      height="117"
      click="showForm()" >
      <mx:columns>
      <mx:DataGridColumn editable="false" width="5">
      <mx:itemRenderer>
      <mx:Component>
      <mx:HBox width="100%" height="15" horizontalAlign="center" verticalAlign="middle">
      <mx:Button
      icon="@Embed(source='/com/serg/reportingTool/assets/images/delete.png')"
      click="outerDocument.deleteContact(event,data)"
      label="D"
      toolTip="Delete"
      width="15"
      height="15"
      />
      </mx:HBox>
      </mx:Component>
      </mx:itemRenderer>
      </mx:DataGridColumn>