From c5c94240a4b90a10dfe0478dc025985464cbd183 Mon Sep 17 00:00:00 2001 From: Glen Chiacchieri Date: Wed, 26 Dec 2012 19:35:07 -0500 Subject: [PATCH] update docs for sortResults constructor function add a simple example of sorting displayed results and update the API table --- select2-latest.html | 53 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) mode change 100755 => 100644 select2-latest.html diff --git a/select2-latest.html b/select2-latest.html old mode 100755 new mode 100644 index 13441398..22dc1385 --- a/select2-latest.html +++ b/select2-latest.html @@ -207,6 +207,7 @@ $("#e10_3").select2({
  • Events: Reacting to External Changes
  • Disabled Mode
  • Custom Matcher Function
  • +
  • Sorting Displayed Results
  • Responsive Design
  • @@ -823,6 +824,44 @@ $("#e17_2").select2({ +
    + +
    +

    Sorting Displayed Results

    +

    Unlike other dropdowns on this page, this one filters results by query string normally, but returns the matched results sorted from shortest to longest by string length. Try typing 'e' and seeing how the results are sorted. This function is useful for sorting results by relevance to a user's query.

    +

    +
    +

    +
    +
    +

    Example Code

    +
    +            
    +
    +
    +