The Trio in the Front End
The Trio structure is requested from the back end whenever a new module is requested. The 3-level JSON object returned contains the complete Categories/Groups/Options structure. The normalizeTrio() function "normalizes" this object into three separate structures:
categories array
groupsObj
optionsObj
They are then stored in TrioStore.trio:
trio {
categories: [
'Registration',
'Basic Characteristics',
// ...
],
groupsObj: {
'00' : {},
'01' : {},
// ...
}
optionsObj : {
'000': {
text: 'A',
extra: 0
},
'001': {
text: 'B',
extra: 1
},
// ...
}
}
Note that the keys to groupObj and optionsObj are zero padded string representations of running integers assigned by trioNarmalize(). This allows for a simple uniform representation of selected options that keeps track of their original order.
Three "selected" arrays are routinely used by the front end to store optionKeys:
- filterSelected: currently active filters
- itemSelected: currently loaded item options (enums, lookups, categorized filters)
- newItemSelected: newly selected option keys ready to be synchronized to the back end
Two Indices, catgoryIndex and groupIndex keep track of the current displayed category and group tabs in either the filter or tagger forms.
The currently selected options are shown in the selectedOptions form in a three-level structure.