6 Replies Latest reply on Oct 7, 2008 6:42 AM by Newsgroup_User

    DataGrid sync problem

    Oceanyahoo
      I use flex sdk 3.
      I have two datagrids sharing same data provider.
      I have the folowing situation.
      1. Each DataGrid has a CheckBox as itemEditor ( the DataGrid are identical in first phase );
      When i change the checkbox state in one , the change is reflected to the second dataGrid, only when the item loose focus, but i can`t intercept any change event on the data provider. (And i tried ).

      2. Because the Checkbox must be enabled or disabled based on a third information in the item data, i use a custom simple item renderer : a vbox handling a checkbox and an overrided data() getter/setter for VBox.
      I have "Bindable" tags and everything is broken for now. I mean, the changes on data are not visible for the other, until i call validateNow() for the unchanged DataGrid.

      The question is what is wrong with the code and if this is the only way to do it, for witch event to call validateNow() ?



      see the codes

        • 1. Re: DataGrid sync problem
          Gregory Lafrance Level 6
          Best to post simplified yet "complete" code sample.
          • 2. Re: DataGrid sync problem
            Level 7

            "Oceanyahoo" <webforumsuser@macromedia.com> wrote in message
            news:gccvoq$pk2$1@forums.macromedia.com...
            >I use flex sdk 3.
            > I have two datagrids sharing same data provider.
            > I have the folowing situation.
            > 1. Each DataGrid has a CheckBox as itemEditor ( the DataGrid are identical
            > in
            > first phase );
            > When i change the checkbox state in one , the change is reflected to the
            > second dataGrid, only when the item loose focus, but i can`t intercept any
            > change event on the data provider. (And i tried ).

            What did you try? I don't see where you've put in an event handler for
            itemEditEnd.

            > 2. Because the Checkbox must be enabled or disabled based on a third
            > information in the item data, i use a custom simple item renderer : a
            > vbox
            > handling a checkbox and an overrided data() getter/setter for VBox.
            > I have "Bindable" tags and everything is broken for now. I mean, the
            > changes
            > on data are not visible for the other, until i call validateNow() for the
            > unchanged DataGrid.
            >
            > The question is what is wrong with the code and if this is the only way to
            > do
            > it, for witch event to call validateNow() ?

            Have you tried calling itemUpdated on the dataprovider collection?


            • 3. Re: DataGrid sync problem
              Oceanyahoo Level 1
              i will try to intercept itemUpdated and see what`s happenin :)
              comming back soon...
              • 4. Re: DataGrid sync problem
                Oceanyahoo Level 1
                not working... maybe i was not very concise so i will try to explain again the problem and simplify the code...
                the first two DataGrids are the same and are syncronized.
                The third witch is just a derived control from a data grid having same structure as above data grids, can`t syncronize the data. Am i missing somthing, i know it`s not "something" but i can`t figure out what is...
                • 5. Re: DataGrid sync problem
                  Oceanyahoo Level 1
                  Finaly found .....

                  Just needed to mark the custom grid as.... editable...
                  • 6. Re: DataGrid sync problem
                    Level 7

                    "Oceanyahoo" <webforumsuser@macromedia.com> wrote in message
                    news:gcf0om$fv5$1@forums.macromedia.com...
                    >i will try to intercept itemUpdated and see what`s happenin :)
                    > comming back soon...

                    No, that's a command you need to dispatch when you change the sub-item of a
                    collection.