2 Replies Latest reply on Dec 24, 2008 2:20 AM by André Pereira

    AdvancedDataGrid index issue

    André Pereira
      Hello,

      I'm having some issues with the index of an advancedatagrid, for example, i noticed that the index of my objects in the datagrid are not the same of the index in my dataprovider, if i keep all the nodes of the advanceddatagrid closed, i have a index that are not the same index if i open all the nodes.

      In my application a have the index of a line for example, and with that, i need to get the object in my dataprovider.

      ps: i dont have the item in the datagrid selected.

      Any ideias?
      thanks,
      Andrlop.
        • 1. Re: AdvancedDataGrid index issue
          Level 7

          "andrlop" <webforumsuser@macromedia.com> wrote in message
          news:giqgj0$ki0$1@forums.macromedia.com...
          > Hello,
          >
          > I'm having some issues with the index of an advancedatagrid, for example,
          > i
          > noticed that the index of my objects in the datagrid are not the same of
          > the
          > index in my dataprovider, if i keep all the nodes of the advanceddatagrid
          > closed, i have a index that are not the same index if i open all the
          > nodes.
          >
          > In my application a have the index of a line for example, and with that, i
          > need to get the object in my dataprovider.

          I think you can treat each "level" of a HierarchicalData object as if it is
          an ArrayCollection, in which case you can use getItemIndex().

          HTH;

          Amy


          • 2. Re: AdvancedDataGrid index issue
            André Pereira Level 1
            quote:

            Originally posted by: Newsgroup User

            "andrlop" <webforumsuser@macromedia.com> wrote in message
            news:giqgj0$ki0$1@forums.macromedia.com...
            > Hello,
            >
            > I'm having some issues with the index of an advancedatagrid, for example,
            > i
            > noticed that the index of my objects in the datagrid are not the same of
            > the
            > index in my dataprovider, if i keep all the nodes of the advanceddatagrid
            > closed, i have a index that are not the same index if i open all the
            > nodes.
            >
            > In my application a have the index of a line for example, and with that, i
            > need to get the object in my dataprovider.

            I think you can treat each "level" of a HierarchicalData object as if it is
            an ArrayCollection, in which case you can use getItemIndex().

            HTH;

            Amy





            hm, do you have a example how can i do that? (sintax example).

            I found a way to solve my problem, i did a selectedIndex (he uses the array that i can see and not the dataprovider's array) in the advanceddatagrid and then i did a selectedItem to get que object in that row, but i think that is workaround alot.