0

I am faceing for the first time against select2 library. I have coded a search box and is working fine except for the sorting.

For now is ordering the results by an ASCII order instead Unicode.

For example:

"Lu" comes before "Lé".

However I need the opposite.

I am using alasqul.js and select2.full.js

Im testing many code lines and functions and failing for now.

Thanks in advance.

EDIT:

JS code:

arr = [ {a: "1", b: "1", c: "ham"}, {a: "2", b: "1", c: "Thór"}, {a: "3", b: "1", c: "Soçao"}]

var results = function(word) {
    var limit = LIMIT_RESULTS + 1;
    var out = [];
    var partialLimit = 0;
    var outaux = [];    



    // search by c:

    outaux = alasql('SELECT a, b, c + "''" as n\
                        FROM ? WHERE c LIKE "%'+word+'%" ORDER BY c LIMIT ' + partialLimit, [arr]);
    out.push.apply(out, outaux);
Breo
  • 1
  • 3
  • 1
    You need to show your code. Please have a read through how to create a [mcve]. – SiKing Jul 17 '17 at 19:58
  • Please see this first [how-to-ask](https://stackoverflow.com/help/how-to-ask) SO is a platform where you can get a good suggestion regarding your problems. But for that, you need to be more specific about what you are asking? what have you done so far? Before asking please see the suggested SO question and take a look at them. Still, you did not find a solution then you can ask a question here. – always-a-learner Jul 18 '17 at 03:00

0 Answers0