From ae2514700b0a62e61d31f4411f9edd1d4a368c73 Mon Sep 17 00:00:00 2001 From: Johann Werner Date: Wed, 18 Nov 2015 14:10:44 +0100 Subject: [PATCH] Merge pull request #688 from AnhNhan-NUR/erxjstomanyeditor_selection_sort ERXJSToManyRelationshipEditor: Selections are also sorted --- .../components/javascript/ERXJSToManyRelationshipEditor.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/components/javascript/ERXJSToManyRelationshipEditor.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/components/javascript/ERXJSToManyRelationshipEditor.java index 9ba3e60abcf..0a73c881760 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/components/javascript/ERXJSToManyRelationshipEditor.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/components/javascript/ERXJSToManyRelationshipEditor.java @@ -259,6 +259,10 @@ private NSArray selectionsFromBindings() { if (canGetValueForBinding(Keys.Selections)) { NSArray result = (NSArray)valueForBinding(Keys.Selections); if(result != null) { + if (hasBinding(Keys.SortKey)) { + String sortKey = stringValueForBinding(Keys.SortKey); + result = ERXArrayUtilities.sortedArraySortedWithKey(result, sortKey); + } return result; } }