make static list honor 'selected' options

This commit is contained in:
rlx 2011-06-06 18:34:40 +00:00
parent ff1714013c
commit 2419ca3a18

View file

@ -110,6 +110,15 @@ Ox.List = function(options, self) {
scrollTimeout: 0, scrollTimeout: 0,
selected: [] selected: []
}); });
if (!self.isAsync) {
self.selected = self.options.items.map(function(item, i) {
return Ox.extend(item, {_index: i})
}).filter(function(item) {
return self.options.selected.indexOf(item[self.options.unique]) > -1;
}).map(function(item) {
return item['_index'];
});
}
self.options.max == -1 && $.extend(self.keyboardEvents, { self.options.max == -1 && $.extend(self.keyboardEvents, {
key_alt_control_a: invertSelection, key_alt_control_a: invertSelection,
key_control_a: selectAll key_control_a: selectAll