From 2bd4156f6cd0b29525f7738973c0b03954b35737 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Mon, 24 Oct 2011 21:50:54 +0000 Subject: [PATCH] update IconList --- source/Ox.UI/js/List/Ox.IconList.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/source/Ox.UI/js/List/Ox.IconList.js b/source/Ox.UI/js/List/Ox.IconList.js index 8e91ae87..28c282c2 100644 --- a/source/Ox.UI/js/List/Ox.IconList.js +++ b/source/Ox.UI/js/List/Ox.IconList.js @@ -212,7 +212,16 @@ Ox.IconList = function(options, self) { return that.$element.value(id, key); } else { that.$element.value(id, key, value); - // FIXME: Like TextList, handle unique id and selection change here + if (key == self.unique) { + // unique id has changed + self.options.selected = self.options.selected.map(function(id_) { + return id_ == id ? value : id_ + }); + } + if (key == self.options.sort[0].key) { + // sort key has changed + that.$element.sort(); + } return that; } };