diff --git a/source/Ox.UI/js/List/CustomList.js b/source/Ox.UI/js/List/CustomList.js index 71573492..ae5fc506 100644 --- a/source/Ox.UI/js/List/CustomList.js +++ b/source/Ox.UI/js/List/CustomList.js @@ -20,6 +20,7 @@ Ox.CustomList = function(options, self) { min: 0, pageLength: 100, query: {conditions: [], operator: '&'}, + resize: null, scrollbarVisible: false, selected: [], sort: [], @@ -32,6 +33,14 @@ Ox.CustomList = function(options, self) { items: function() { self.$list.options({items: self.options.items}); }, + itemWidth: function() { + var width = self.options.itemWidth - Ox.UI.SCROLLBAR_SIZE; + if (self.options.resize) { + that.$element.find('.OxItem').each(function(element) { + self.options.resize($(this), width); + }); + } + }, selected: function() { self.$list.options({selected: self.options.selected}); // FIXME: TableList doesn't trigger event here @@ -42,7 +51,9 @@ Ox.CustomList = function(options, self) { self.$list = Ox.List({ construct: function(data) { - return self.options.item(data, self.options.itemWidth - Ox.UI.SCROLLBAR_SIZE).addClass('OxTarget'); + return self.options.item( + data, self.options.itemWidth - Ox.UI.SCROLLBAR_SIZE + ).addClass('OxTarget'); }, draggable: self.options.draggable, itemHeight: self.options.itemHeight, @@ -99,6 +110,22 @@ Ox.CustomList = function(options, self) { return that; }; + /*@ + selectPosition select position + @*/ + that.selectPosition = function(pos) { + self.$list.selectPosition(pos); + return that; + }; + + /*@ + size size + @*/ + that.size = function() { + self.$list.size(); + return that; + }; + return that; }; \ No newline at end of file