Skip to content

Commit 53eaf1f

Browse files
committed
Results sorting option. Refs select2#95
1 parent 739a7bf commit 53eaf1f

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
@@ -702,6 +702,9 @@ the specific language governing permissions and limitations under the Apache Lic
702702
populate=function(results, container, depth) {
703703

704704
var i, l, result, selectable, compound, node, label, innerContainer, formatted;
705+
706+
results = opts.sortResults(results, container, query);
707+
705708
for (i = 0, l = results.length; i < l; i = i + 1) {
706709

707710
result=results[i];
@@ -2388,6 +2391,9 @@ the specific language governing permissions and limitations under the Apache Lic
23882391
formatSelection: function (data, container) {
23892392
return data ? data.text : undefined;
23902393
},
2394+
sortResults: function (results, container, query) {
2395+
return results;
2396+
},
23912397
formatResultCssClass: function(data) {return undefined;},
23922398
formatNoMatches: function () { return "No matches found"; },
23932399
formatInputTooShort: function (input, min) { var n = min - input.length; return "Please enter " + n + " more character" + (n == 1? "" : "s"); },

0 commit comments

Comments
 (0)