From 7b5d24461de03fe9357dd96252b254ee770ca460 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 13 Feb 2014 09:28:43 +0000 Subject: [PATCH] fix setting value on array lists --- source/Ox.UI/js/List/List.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/source/Ox.UI/js/List/List.js b/source/Ox.UI/js/List/List.js index d3d3507e..5f359bcc 100644 --- a/source/Ox.UI/js/List/List.js +++ b/source/Ox.UI/js/List/List.js @@ -1819,7 +1819,8 @@ Ox.List = function(options, self) { id = args.shift(), pos = Ox.isNumber(id) ? id : getPositionById(id), $item = self.$items[pos], - data = $item ? $item.options('data') : {}; + data = $item ? $item.options('data') : {}, + updateItems = false; if (arguments.length == 1) { return data; } else if (arguments.length == 2 && Ox.isString(arguments[1])) { @@ -1834,10 +1835,22 @@ Ox.List = function(options, self) { } if (!self.isAsync) { self.options.items[pos][key] = value; + } else if(self.items) { + self.items[Ox.getIndexById(self.items, id)][key] = value; + updateItems = true; } data[key] = value; }); $item.options({data: data}); + if (updateItems) { + self.options.items = Ox.api(self.items, { + cache: true, + map: self.options.map, + sort: self.options.sort, + sums: self.options.sums, + unique: self.options.unique + }); + } return that; } };