1 Reply Latest reply on Dec 25, 2008 6:50 AM by Newsgroup_User

    Back to Basics for Me

    John Hall Level 4
      Thanks to Amy's suggestion regarding a problem I was having, I went looking for compareFunction on a GroupCollection to solve a problem I was having. I think I found something that speaks directly to my issue at:

      http://thefactoryfactory.com/wordpress/?p=373

      However, he suggests overriding the default behavior of HierarchicalData to accomplish the sorting of a subgroup. I figured, hey John, you finally get to implement all those Collin Moock books you've been reading, so I copied the HierarchicalData class and started to revamp it according to his instructions when I realized there are dependencies within the HierarchicalCollectionView class and cursor class that appear to me to be called directly. Does that imply that I need to customize all three classes to accomplish what he is suggesting?

      Oh, sometimes I kind of get it and then I realize Microsoft BASIC wasn't all THAT bad.
        • 1. Re: Back to Basics for Me
          Level 7

          "John Hall" <webforumsuser@macromedia.com> wrote in message
          news:giv343$6he$1@forums.macromedia.com...
          > Thanks to Amy's suggestion regarding a problem I was having, I went
          > looking for
          > compareFunction on a GroupCollection to solve a problem I was having. I
          > think I
          > found something that speaks directly to my issue at:
          >
          > http://thefactoryfactory.com/wordpress/?p=373
          >
          > However, he suggests overriding the default behavior of HierarchicalData
          > to
          > accomplish the sorting of a subgroup. I figured, hey John, you finally get
          > to
          > implement all those Collin Moock books you've been reading, so I copied
          > the
          > HierarchicalData class and started to revamp it according to his
          > instructions
          > when I realized there are dependencies within the
          > HierarchicalCollectionView
          > class and cursor class that appear to me to be called directly. Does that
          > imply
          > that I need to customize all three classes to accomplish what he is
          > suggesting?
          >
          > Oh, sometimes I kind of get it and then I realize Microsoft BASIC wasn't
          > all
          > THAT bad.

          I think you'll just have to analyze the classes and figure out the best
          place(s) to make the changes yourself, if that's what you want to do.

          However, I think he needed to hack HierarchicalData because he's not using a
          GroupingCollection _and_ because he's using a sort field and not a compare
          function. Since GroupingCollection touches every single node, when you use
          a compare function you get very fine grained control over what happens.