diff --git a/source/Ox.UI/js/List/TreeList.js b/source/Ox.UI/js/List/TreeList.js index 8246d37b..24580ee7 100644 --- a/source/Ox.UI/js/List/TreeList.js +++ b/source/Ox.UI/js/List/TreeList.js @@ -1,17 +1,18 @@ 'use strict'; /*@ -Ox.TreeList TreeList Object - ([options[, self]]) -> TreeList Object +Ox.TreeList Tree List + ([options[, self]]) -> Tree List Object options Options object - data data to be parsed to items, needs documentation + data Data to be parsed as items (needs documentation) + expanded If true, and data is not null, all items are expanded icon Image URL, or function that returns an image object - items array of items - max maximum number of items that can be selected, -1 unlimited - min minimum number of items that have to be selected - selected selected ids - width list width - self shared private variable + items Array of items + max Maximum number of items that can be selected, -1 unlimited + min Minimum number of items that have to be selected + selected Selected ids + width List width + self Shared private variable @*/ Ox.TreeList = function(options, self) { @@ -22,6 +23,7 @@ Ox.TreeList = function(options, self) { var that = Ox.Element({}, self) .defaults({ data: null, + expanded: false, icon: null, items: [], max: 1, @@ -172,12 +174,12 @@ Ox.TreeList = function(options, self) { function parseData(key, value) { var ret = { - expanded: false, id: Ox.uid().toString(), title: key.toString() + ': ' }, type = Ox.typeOf(value); if (type == 'array' || type == 'object') { + ret.expanded = self.options.expanded; ret.title += Ox.toTitleCase(type) + ' [' + Ox.len(value) + ']'; ret.items = type == 'array' ? value.map(function(v, i) {