While StructSort() works great for returning an array of keys sorted on a
single field, I would like to sort on multiple fields.

For example I've got a structure (actually a collection CFC) containing
structures (actually domain CFCs of the same type).  I would like to sort on
two properties in the structs: "BeginTime" and "EndTime".

Just for now I think it's easiest forget that we're talking about CFCs (but
understand that since we are using a different data store, like a query,
really isn't an option).

Actually getting the job done isn't all that hard... but I'm looking
specifically for the "best" way to do it.  Both the most flexible (it should
allow for one or more properties and sort types to be specified) and as fast
as possible.

I'm just looking for ideas... I've considered some odd things that would
work (for example constructing a query of the properties and keys and
offloading the sort to QoQ) but before I get neck deep into it I'd like some
other ideas.

In the end I want to construct a root collection component from this that
will allow easy creation of domain specific collection components.  For
example an "employeeCollection" component might extend this one and contain
instantiated "employee" components.  Using this sort it might feature a
"getSortedByLevelAndSalary()" method.

Does any of this make sense outside my head?  ;^)

Thanks,

Jim Davis
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to