-
Notifications
You must be signed in to change notification settings - Fork 0
Data Input Formats
James Adam Wasson edited this page Mar 22, 2018
·
30 revisions
<ul>
<li name="Item 1" searchable="search me" selected="false"><ul>
<li name="Item 1.1" value="1.1" searchable="search me" selected="false"></li>
<li name="Item 1.2" searchable="search me" selected="false"><ul>
<li name="Item 1.2.1" value="1.2.1" searchable="search me" selected="false"></li>
</ul></li>
</ul></li>
<li name="Item 2" value="2" searchable="search me" selected="false"></li>
</ul>
- String HTML should be input using the data-load-type="HTML"
- HTML node lists should be input using the data-load-type="liveHTML"
- Headers are specified by the <li> followed by <ul> tag
- Data is always stored in the <li> tag
- Data for headers
- name: the name displayed for the user
- searchable: the text that can also be used to match this item
- selected: if this data item is pre-select (defaults to false)
- Data for items
- value: the value to be retrieved when the user selects this item
- name: the name displayed for the user
- searchable: the text that can also be used to match this item
- selected: if this data item is pre-select (defaults to false)
## 2. Array Input Data
#### Format Should be like :
var array = [
{ // a header
"name": "Item1",
"searchable": "Item1",
"selected": false,
"items": [
{ // list of items
"name": "Item1.1",
"searchable": "Item1.1",
"selected": false,
"value" : "1.1"
},
{ // item 1.2 is also a header
"name": "Item1.2",
"searchable": "Item1.2",
"selected": false,
"items" : [
{ // list of items for 1.2
"name": "Item1.2.1",
"searchable": "Item1.2.1",
"selected": false,
"value" : "1.2.1"
},
{
"name": "Item1.2.2",
"searchable": "Item1.2.2",
"selected": false,
"value" : "1.2.2"
}
]
} ]
}, ];
Example: Array = [ {Item1 [{Item1.1} , {Item1.2 [ {Item 1.2.1}] } ]}, {Item 2}]
Item 1 , Item 1.2 are headers
Item 1.1, Item 1.2 are items for header "Item 1"
Item 1.2.1 is the item for header "Item 1.2"
- Data is always stored in Items within the header
- Data for headers
- name: the name displayed for the user
- searchable: the text that can also be used to match this item
- selected: if this data item is pre-select (defaults to false)
- Data for items
- value: the value to be retrieved when the user selects this item
- name: the name displayed for the user
- searchable: the text that can also be used to match this item
- selected: if this data item is pre-select (defaults to false)
<data>
<item>
<name>Item 1</name>
<searchable>Item 1</searchable>
<selected>false</selected>
<subitem1>
<name>Item 1.1</name>
<value>Item 1.1</value>
<searchable>Item 1.1</searchable>
<selected>false</selected>
</subitem1>
<subitem1>
<name>Item 1.2</name>
<searchable>Item 1.2</searchable>
<selected>false</selected>
<subitem2>
<name>Item 1.2.1</name>
<value>Item 1.2.1</value>
<searchable>Item 1.2.1</searchable>
<selected>false</selected>
</subitem2>
<subitem2>
<name>Item 1.2.2</name>
<value>Item 1.2.2</value>
<searchable>Item 1.2.2</searchable>
<selected>false</selected>
</subitem2>
</subitem1>
</item>
<item>
<name>Item 2</name>
<value>Item 2</value>
<searchable>Item 2</searchable>
<selected>false</selected>
</item>
</data>
- Headers are evidenced by lack of a <value> tag and presence of <subitemX> tags under the <item> or <subitemY> tags.
- Data is always specified by the <value> tag
- Items under headers are specified by <subitem> tags with a number corresponding to the level of indentation of the subitem, i.e. <subitem1> would mean that item has one level of indentation under the header.
- Data for headers:
- name: The name as it will appear in the multiselect
- searchable: Additional text beyond the name that can be used to search for that specific item
- selected: Determines whether the item will be pre-selected (false by default)
- Data for items and subitems:
- value: The value retrieved when the item is selected
- name: The name as it will appear in the multiselect
- searchable: Additional text beyond the name that can be used to search for that specific item
- selected: Determines whether the item will be pre-selected (false by default)
- An Image will always take precedence over and icon class (i.e. both will not be displayed)