Skip to content

Internal Data Structure

James Adam Wasson edited this page Apr 5, 2018 · 9 revisions

In this document we will be defining the standard Internal Data Structure for the project


At the highest level we have an object of JS Multiselects

The name of the individual multiselect is the key and all individual data is stored by this key

Object Layout:

{
     "Name Of Multi-select 1": {
         Data: (as defined below),
         Settings: (Settings defined by the user),
         Element: (A Jquery Element),
         Title: (title to be displayed for multiselect),
     }, 
     "Name Of Multi-select 2": {
         Data: (as defined below),
         Settings: (Settings defined by the user),
         Element: (A Jquery Element)
         Title: (title to be displayed for multiselect),
     }, 
     .
     .
     .
     "Name Of Multi-select N":  {
         Data: (as defined below),
         Settings: (Settings defined by the user),
         Element: (A Jquery Element)
         Title: (title to be displayed for multiselect),
     }
}

Each multiselect will have a unique ID

Each ID is like follows
id = "JS_Multiselect-" + (Name of Multiselect)


The internal storage of the displayed data

{
    [
    {
         "@name": "Item 1",
         "@value": "Value of Item 2.1",
         "@selected": "Is item selected",
         "@element": "A Jquery element",
         "@searchable": "This text is searchable for this item",
         "@isHeader": "A true false value if this item is a header",
         "@image": "a path to an image file"
    },
    {
        "@name": "Item 2",
        "@selected": "Is item selected",
        "@element": "A Jquery element",
        "@searchable": "This text is searchable for this item",
        "@isHeader": "A true false value if this item is a header",
        "@image": "a path to an image file"
        "@children": [{
             "@name": "Item 2.1",
             "@value": "Value of Item 2.1",
             "@selected": "Is item selected",
             "@element": "A Jquery element",
             "@searchable": "This text is searchable for this item"
             "@isHeader": "A true false value if this item is a header",
             "@image": "a path to an image file"    
        }]
    },
    {
        "@name": "Item 3"
        "@selected": "Is item selected",
        "@element": "A Jquery element",
        "@searchable": "This text is searchable for this item",
        "@isHeader": "A true false value if this item is a header",
        "@image": "a path to an image file"
        "@children": [{
             "@name": "Item 3.1",
             "@value": "Value of Item 4",
             "@selected": "Is item selected",
             "@element": "A Jquery element",
             "@searchable": "This text is searchable for this item"
             "@isHeader": "A true false value if this item is a header",
             "@image": "a path to an image file"
        }]
    }
    ]
}