2 Replies Latest reply on Mar 10, 2009 8:15 AM by henrihoffmann

    Datagrid itemrenderer to popup log text & itemeditend

    henrihoffmann
      Hi,
      have a app with many datagrids and some popups, because of very long data. Some fields a defined in the database with "not null", so I need to insure that this fields are filled with
      <datagrid itemeditend="check()">.

      The itemrenderer for the datagridcolumn is defined as:

      <mx:Text xmlns:mx=" http://www.adobe.com/2006/mxml"
      implements="mx.controls.listClasses.IDropInListItemRenderer" ...

      I tried a couple of days to

      "dispatchEvent(new DataGridEvent(DataGridEvent.ITEM_EDIT_END,true,false,_listData.columnIndex,'Text',_listDa ta.rowIndex))"

      to pass the changed to to the check() routine, but without success. In the check() routine, I currently pickup the changed data with:

      var newValue:String = TextInput(event.currentTarget.itemEditorInstance).text;
      result: null exception.

      How to do this right? I tested almost any available sample, but the check() routine is unable to get the changed data.

      Thanks a lot

      Henri
        • 1. Re: Datagrid itemrenderer to popup log text &amp; itemeditend
          Level 7

          "henrihoffmann" <webforumsuser@macromedia.com> wrote in message
          news:gp593g$bm3$1@forums.macromedia.com...
          > Hi,
          > have a app with many datagrids and some popups, because of very long data.
          > Some fields a defined in the database with "not null", so I need to insure
          > that
          > this fields are filled with
          > <datagrid itemeditend="check()">.
          >
          > The itemrenderer for the datagridcolumn is defined as:
          >
          > <mx:Text xmlns:mx=" http://www.adobe.com/2006/mxml"
          > implements="mx.controls.listClasses.IDropInListItemRenderer" ...
          >
          > I tried a couple of days to
          >
          > "dispatchEvent(new
          > DataGridEvent(DataGridEvent.ITEM_EDIT_END,true,false,_listData.columnIndex,'Text
          > ',_listData.rowIndex))"
          >
          > to pass the changed to to the check() routine, but without success. In the
          > check() routine, I currently pickup the changed data with:
          >
          > var newValue:String =
          > TextInput(event.currentTarget.itemEditorInstance).text;
          > result: null exception.
          >
          > How to do this right? I tested almost any available sample, but the
          > check()
          > routine is unable to get the changed data.
          >
          > Thanks a lot

          I think it might be easier to approach it from the other end. When you
          instantiate the objects that are being passed to the DataGrid, just make
          sure that property is not null to begin with. And you can also do it on the
          back end side, by converting any nulls to empty strings or zeroes or
          whatever makes sense.


          • 2. Re: Datagrid itemrenderer to popup log text &amp; itemeditend
            henrihoffmann Level 1
            Thanks a lot for this tip.

            But what's the right way, at a database backed datagrid, to post the ITEM_EDIT_END event in a itemrenderer? In the generated AS (build application from database) , the database update trigger is this event, so I assume, there must be some official way to trigger this event with the correct data structure, because I have the same problem in the AS to get the data. I have a lot of sql relational things between tables and have to make sure, that the data are valid, to avoid minus sql codes from the database.

            Thanks again

            Henri