From 888bf094ad6827d97e99164a308791157a0b9e21 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Wed, 30 May 2012 02:29:38 +0200 Subject: [PATCH] only sort object keys in treelist --- source/Ox.UI/js/List/TreeList.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/Ox.UI/js/List/TreeList.js b/source/Ox.UI/js/List/TreeList.js index 3b292486..701a1b26 100644 --- a/source/Ox.UI/js/List/TreeList.js +++ b/source/Ox.UI/js/List/TreeList.js @@ -173,10 +173,9 @@ Ox.TreeList = function(options, self) { if (type == 'array' || type == 'object') { ret.title += Ox.toTitleCase(type) + ' [' + Ox.len(value) + ']'; - ret.items = Ox.sort( - type == 'array' ? value.map(function(v, i) { + ret.items = type == 'array' ? value.map(function(v, i) { return parseData(i, v); - }) : Object.keys(value).map(function(k) { + }) : Ox.sort(Object.keys(value)).map(function(k) { return parseData(k, value[k]); }) );