Skip to content

Commit df5a03f

Browse files
committed
Merge pull request select2#594 from omab/master
Results sorting on populateResults function
2 parents 7f83d82 + 53eaf1f commit df5a03f

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

select2.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,9 @@ the specific language governing permissions and limitations under the Apache Lic
705705
populate=function(results, container, depth) {
706706

707707
var i, l, result, selectable, compound, node, label, innerContainer, formatted;
708+
709+
results = opts.sortResults(results, container, query);
710+
708711
for (i = 0, l = results.length; i < l; i = i + 1) {
709712

710713
result=results[i];
@@ -2402,6 +2405,9 @@ the specific language governing permissions and limitations under the Apache Lic
24022405
formatSelection: function (data, container) {
24032406
return data ? data.text : undefined;
24042407
},
2408+
sortResults: function (results, container, query) {
2409+
return results;
2410+
},
24052411
formatResultCssClass: function(data) {return undefined;},
24062412
formatNoMatches: function () { return "No matches found"; },
24072413
formatInputTooShort: function (input, min) { var n = min - input.length; return "Please enter " + n + " more character" + (n == 1? "" : "s"); },

0 commit comments

Comments
 (0)