diff --git a/source/Ox.UI/js/List/Ox.List.js b/source/Ox.UI/js/List/Ox.List.js index 84e0efd5..28488010 100644 --- a/source/Ox.UI/js/List/Ox.List.js +++ b/source/Ox.UI/js/List/Ox.List.js @@ -54,6 +54,7 @@ Ox.List = function(options, self) { self = self || {}; var that = Ox.Container({}, self) .defaults({ + _tree: false, centered: false, construct: null, draggable: false, @@ -83,7 +84,7 @@ Ox.List = function(options, self) { } : sort; }); - if (Ox.isArray(self.options.items)) { + if (Ox.isArray(self.options.items) && !self.options._tree) { self.options.items = Ox.api(self.options.items, { cache: true, sort: self.options.sort, @@ -121,7 +122,8 @@ Ox.List = function(options, self) { $items: [], $pages: [], format: {}, - isAsync: true, + //isAsync: true, + isAsync: !self.options._tree, itemMargin: self.options.type == 'text' ? 0 : 8, // 2 x 4 px margin ... fixme: the 2x should be computed later keyboardEvents: { key_control_c: copyItems, @@ -457,7 +459,6 @@ Ox.List = function(options, self) { var height = getHeight(), lastItemHeight = height % self.options.itemHeight || self.options.itemHeight, visibleItems = Math.ceil(height / self.options.itemHeight); - //Ox.print('FFP!!!', height) if (self.listLength < visibleItems) { Ox.range(self.listLength, visibleItems).forEach(function(i) { var $item = Ox.ListItem({ @@ -1463,9 +1464,9 @@ Ox.List = function(options, self) { $item.insertAfter($items[i - 1]); } }); - ///////self.options.items.splice.apply(self.options.items, Ox.merge([pos, 0], items)); + self.options.items.splice.apply(self.options.items, Ox.merge([pos, 0], items)); self.$items.splice.apply(self.$items, Ox.merge([pos, 0], $items)); - ///////self.listLength = self.options.items.length; + self.listLength = self.options.items.length; //loadItems(); updatePositions(); } @@ -1569,14 +1570,14 @@ Ox.List = function(options, self) { self.selected.indexOf(i) > -1 && deselect(i); self.$items[i].remove(); }); - ///////self.options.items.splice(pos, length); + self.options.items.splice(pos, length); self.$items.splice(pos, length); self.selected.forEach(function(v, i) { if (v >= pos + length) { self.selected[i] -= length; } }); - ///////self.listLength = self.options.items.length; + self.listLength = self.options.items.length; updatePositions(); } } diff --git a/source/Ox.UI/js/List/Ox.TextList.js b/source/Ox.UI/js/List/Ox.TextList.js index 70423312..86f3498c 100644 --- a/source/Ox.UI/js/List/Ox.TextList.js +++ b/source/Ox.UI/js/List/Ox.TextList.js @@ -604,7 +604,6 @@ Ox.TextList = function(options, self) { } function getCell(id, key) { - Ox.print('List', 'getCell', id, key) var $item = getItem(id); key = key || ''; // fixme: what is this? return $($item.find('.OxCell.OxColumn' + Ox.toTitleCase(key))[0]); diff --git a/source/Ox.UI/js/List/Ox.TreeList.js b/source/Ox.UI/js/List/Ox.TreeList.js index f41cd3c8..4514c199 100644 --- a/source/Ox.UI/js/List/Ox.TreeList.js +++ b/source/Ox.UI/js/List/Ox.TreeList.js @@ -44,6 +44,7 @@ Ox.TreeList = function(options, self) { } that.$element = Ox.List({ + _tree: true, construct: constructItem, itemHeight: 16, items: parseItems(),