Help with Arrays/Structs
Hello,
I am working on a page where one can browse our users. Each of our users has pieces of information associated with them like "User Type", "Active", "Permissions", etc... I would like each of these pieces of information to act as a filter for the main users query. For instance, if I filter by the Administrator User Type, then the query should pull only those records who are Administrators. (similar to how http://www.newegg.com filters their products)
I am trying to figure out what the best way is to deal with all this data. Right now I am putting each user type into a structure that is nested into an array (see code below). I can't seem to figure out how to access and change the values that are in the nested Structures.
Help!!!
<cfset myArray2 = ArrayNew(1)>
<cfscript>
filters = ArrayNew(1);
for(i=1; i lte qSelectAllUserTypes.recordCount; i++){
"#qSelectAllUserTypes.user_type_description#" = StructNew();
"#qSelectAllUserTypes.user_type_description#.displayName" = qSelectAllUserTypes["user_type_description"];
"#qSelectAllUserTypes.user_type_description#.id" = qSelectAllUserTypes["user_type_id"];
"#qSelectAllUserTypes.user_type_description#.on" = 0;
AddIt = ArrayAppend(filters, "#evaluate(qSelectAllUserTypes.user_type_description)#");
}
</cfscript>
| array | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| 1 |
| ||||||||
| 2 |
| ||||||||
| 3 |
| ||||||||
| 4 |
| ||||||||
