5 Replies Latest reply on Mar 19, 2008 10:38 AM by GerryIsHere

    Data Grid in a List Component???

    GerryIsHere Level 1
      Hi there!

      I have a populated List Component set to Multiple Selection.
      This list contains titles of a magazine issues.

      I wish to allow the user to select one or more items in the list and enter the quantity of the selected issue(s) he/she wants to receive.

      Is it possible to achieve this with a Data GRid integrated in the List Component or which simplier solution must I contemplate?

      I thank you in advance for indicating the best way to explore.

      Best regards,
      Gerry
        • 1. Re: Data Grid in a List Component???
          Greg Dove Level 4
          You can't put a DataGrid inside a list component. Or rather, I wouldn't try to do that.

          Believe it or not, a DataGrid is actually an enhanced version of List component, and based on what you describe is probably what you want to use instead of a List component. You could have a column for quantity and have the values default to zero. That column can have editable cells that the user could change when it was selected.
          • 2. Re: Data Grid in a List Component???
            Greg Dove Level 4
            Here's a quick example.

            Drag a DataGrid component onto the stage and give it the name:
            my_dg

            then use this code in the same frame on new layer
            • 3. Data Grid in a List Component???
              GerryIsHere Level 1
              Hi GWD and thanks for responding.

              I fully understood your explanations and the example you provided.

              I'll give it a try, for sure.
              But I want to know:
              - How do I populate a DataGrid Component? Like a List Component? (you said they are quite the same, I assume methods to apply are identical...)
              -In the same way, I can pull out the data from a DataGrid as I do for the List, right?

              Thanks again!

              Best,
              gerry
              • 4. Re: Data Grid in a List Component???
                Greg Dove Level 4
                You can basically populate it like the example above. They key difference is that you don't have specific label and data properties for your 'items'.

                The other way is to set up an array of objects as a dataprovider. If someone else hasn't provided you an example I'll make one later on and post it. Its not much different to that except you don't use 'addItem' etc
                • 5. Re: Data Grid in a List Component???
                  GerryIsHere Level 1
                  Gotcha!

                  Will you be there tomorrow?
                  I must leave home by now.
                  I give a try to this formula this evening and by tomorrow give you my feedback with explanations about the purpose of the DG.

                  Thank you very much for your help.

                  Best,
                  Gerry