9 Replies Latest reply on Nov 7, 2008 11:47 AM by Jorlett32

    Filters in ADG

    Jorlett32
      My situation is this.

      I have an object collection for my data grid. Depending on a tree selection the data is filtered to that specific group. I am using a group by and all of that is working fine. Internal to the canvas displaying my grid however are another set of filters that further filter out the data.

      Since there is only one filter function on the grid I am assuming that I would have to make the filter function use all the different types and return true or false. That all makes sence I just want to make sure I am assuming that correctly.

      Also with respect to filters, if I have expanded a group and am viewing the internal data, then navigate to the tree which controls one of the filters the grid data goes blank until I scroll away from the group by column and then every thing works fine. I am assuming there is a refresh somwhere however I am calling the data refresh so is there a grid refresh? I don't see it on the list of properties / methods off the data grid so it might be somewhere else.

      Any thoughts ? Thanks in advance for any assistance
      -D
        • 1. Re: Filters in ADG
          Level 7

          "Jorlett32" <webforumsuser@macromedia.com> wrote in message
          news:geagd0$60c$1@forums.macromedia.com...
          > My situation is this.
          >
          > I have an object collection for my data grid. Depending on a tree
          > selection
          > the data is filtered to that specific group. I am using a group by and all
          > of
          > that is working fine. Internal to the canvas displaying my grid however
          > are
          > another set of filters that further filter out the data.
          >
          > Since there is only one filter function on the grid I am assuming that I
          > would
          > have to make the filter function use all the different types and return
          > true or
          > false. That all makes sence I just want to make sure I am assuming that
          > correctly.
          >
          > Also with respect to filters, if I have expanded a group and am viewing
          > the
          > internal data, then navigate to the tree which controls one of the filters
          > the
          > grid data goes blank until I scroll away from the group by column and then
          > every thing works fine. I am assuming there is a refresh somwhere however
          > I am
          > calling the data refresh so is there a grid refresh? I don't see it on
          > the
          > list of properties / methods off the data grid so it might be somewhere
          > else.

          It's on the collection...


          • 2. Re: Filters in ADG
            Jorlett32 Level 1
            the refresh is on the collection?

            so this is my process

            filterInvoke - test for filter type on collection set regex val for test
            refresh collection

            IHierarchicalCollectionView(_cQuestionGrid.dataProvider).refresh();
            _caAnswerGridData.refresh();

            but the wierd hide everything unless i scroll around problem persists

            does that make sense ?
            • 3. Re: Filters in ADG
              Level 7

              "Jorlett32" <webforumsuser@macromedia.com> wrote in message
              news:geamjn$e9h$1@forums.macromedia.com...
              > the refresh is on the collection?
              >
              > so this is my process
              >
              > filterInvoke - test for filter type on collection set regex val for test
              > refresh collection
              >
              > IHierarchicalCollectionView(_cQuestionGrid.dataProvider).refresh();
              > _caAnswerGridData.refresh();
              >
              > but the wierd hide everything unless i scroll around problem persists
              >
              > does that make sense ?
              >

              Not really..I think you might have gone too far abbreviating your thoughts
              :-)


              • 4. Re: Filters in ADG
                Jorlett32 Level 1
                Alright, I do have a tendancy to do that. Here is the whole idea which is working minus the strange blank grid - scroll issue.

                I have a <mx:HDividedBox> with a canvas object in it. At "Login" the flex object goes back to the webserver via flash remoting and gets a data store object. That data store object sends a message to an app server which starts up an anylitics engine. The web server app then collects an interface from the engine and returns.

                The remote handler on the flex app then creates a series of component systems based on login type. A component system consists of a left (navigation) and a right (main interaction area).

                The current system (the initial for this project in a long line of others) has a tree with several root nodes as the left component. Each root has one level of children all pulled from the engine based on a data structure. For simplicity sake lets consider these to be surveys.

                The right component consists of an advanced data grid with a grouped collection on the category of each survey. The data in the grid consists of all the questions in the survey.

                When the user selects a node in the tree the collection is filtered. The filter method checks a match on the selected node (survey name and maybe category name if selected).

                The select callback on the tree calls the _cComplianceGrid.FilterGrid which calls the

                IHierarchicalCollectionView(_cQuestionGrid.dataProvider).refresh();
                _caAnswerGridData.refresh();

                where the _cQuestionGrid is the advanced data grid and the _caAnswerGridData is the collection of survey data and the answers the user is editing.

                My problem is when the user selects a different survey while they are working with one the grid goes blank and resets the horizontal scroll. If the user scrolls away from the first column (where the group by is located) and scrolls back the new survey's groups are there.

                That is less than fantastic behavior. Does that make more sense?
                • 5. Re: Filters in ADG
                  Level 7

                  "Jorlett32" <webforumsuser@macromedia.com> wrote in message
                  news:gect6m$llp$1@forums.macromedia.com...
                  > Alright, I do have a tendancy to do that. Here is the whole idea which is
                  > working minus the strange blank grid - scroll issue.
                  >
                  > I have a <mx:HDividedBox> with a canvas object in it. At "Login" the flex
                  > object goes back to the webserver via flash remoting and gets a data store
                  > object. That data store object sends a message to an app server which
                  > starts
                  > up an anylitics engine. The web server app then collects an interface
                  > from the
                  > engine and returns.
                  >
                  > The remote handler on the flex app then creates a series of component
                  > systems
                  > based on login type. A component system consists of a left (navigation)
                  > and a
                  > right (main interaction area).
                  >
                  > The current system (the initial for this project in a long line of others)
                  > has
                  > a tree with several root nodes as the left component. Each root has one
                  > level
                  > of children all pulled from the engine based on a data structure. For
                  > simplicity sake lets consider these to be surveys.
                  >
                  > The right component consists of an advanced data grid with a grouped
                  > collection on the category of each survey. The data in the grid consists
                  > of
                  > all the questions in the survey.
                  >
                  > When the user selects a node in the tree the collection is filtered. The
                  > filter method checks a match on the selected node (survey name and maybe
                  > category name if selected).
                  >
                  > The select callback on the tree calls the _cComplianceGrid.FilterGrid
                  > which
                  > calls the
                  >
                  > IHierarchicalCollectionView(_cQuestionGrid.dataProvider).refresh();
                  > _caAnswerGridData.refresh();
                  >
                  > where the _cQuestionGrid is the advanced data grid and the
                  > _caAnswerGridData
                  > is the collection of survey data and the answers the user is editing.
                  >
                  > My problem is when the user selects a different survey while they are
                  > working
                  > with one the grid goes blank and resets the horizontal scroll. If the
                  > user
                  > scrolls away from the first column (where the group by is located) and
                  > scrolls
                  > back the new survey's groups are there.
                  >
                  > That is less than fantastic behavior. Does that make more sense?

                  That sounds like it might be related to Q2
                  http://www.magnoliamultimedia.com/flex_examples/Amys_Flex_FAQ.pdf

                  HTH;

                  Amy


                  • 6. Re: Filters in ADG
                    Jorlett32 Level 1
                    Q2 was very helpfull in getting the original problem I had with this solution, which was an item renderer having a problem with showing my data all over the place. So my itemRenderer has the

                    override public function set data(oData:Object):void

                    which is where I put my code to determine what type of question the survay is. However this new issue seems to have something do to with when the grid's data is refreshed. To give you a different way to look at it, if I am scrolled over to the far left and then click on a tree node the refresh seems to work fine, its only when I am working with the itemRenderers farther to the right and click the tree node. The columns are even a little mucked up in so much that the name of the column on the far left is now the column that I was on when clicked on the tree.

                    In .net when I have a problem like this its because the grid is busy trying to update complex controls while re-filtering data which is why there is a begin update and end update call. I just don't see one here.

                    Anyways if you have any other ideas that would be great, if not you have been more than helpfull thanks a bunch.

                    -D
                    • 7. Re: Filters in ADG
                      Level 7

                      "Jorlett32" <webforumsuser@macromedia.com> wrote in message
                      news:gef7kl$r31$1@forums.macromedia.com...
                      > Q2 was very helpfull in getting the original problem I had with this
                      > solution,
                      > which was an item renderer having a problem with showing my data all over
                      > the
                      > place. So my itemRenderer has the
                      >
                      > override public function set data(oData:Object):void
                      >
                      > which is where I put my code to determine what type of question the survay
                      > is.
                      > However this new issue seems to have something do to with when the grid's
                      > data
                      > is refreshed. To give you a different way to look at it, if I am scrolled
                      > over
                      > to the far left and then click on a tree node the refresh seems to work
                      > fine,
                      > its only when I am working with the itemRenderers farther to the right and
                      > click the tree node. The columns are even a little mucked up in so much
                      > that
                      > the name of the column on the far left is now the column that I was on
                      > when
                      > clicked on the tree.
                      >
                      > In .net when I have a problem like this its because the grid is busy
                      > trying to
                      > update complex controls while re-filtering data which is why there is a
                      > begin
                      > update and end update call. I just don't see one here.
                      >
                      > Anyways if you have any other ideas that would be great, if not you have
                      > been
                      > more than helpfull thanks a bunch.

                      The only advice I have is to trim it down and trim it down until you can
                      isolate the source of the problem. I recently had a problem that I never
                      could determine a cause for, but that was solved by using a TextArea control
                      in an itemRenderer instead of a Text control. I spent several days
                      debugging the problem, but never arrived at a satisfactory solution (because
                      the Text control really _was_ the better control to use there).


                      • 8. Re: Filters in ADG
                        Jorlett32 Level 1
                        Sounds good, thanks for your help on this. If I figure it out I'll post back to this thread just for some closure.

                        -D
                        • 9. Re: Filters in ADG
                          Jorlett32 Level 1
                          Got it, it was the order of the refresh and load. There where just so many things going on because answers sometimes will cause some questions to show or hide and there are also filters in place to show or hide some questions as well.

                          Either way it was a matter of what was causing the refresh.

                          Thanks again for your help. In another thread I posted a sorted list implementation that I would like your opinion on if you feel like looking for sake of making things faster and all of that.

                          -D