Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot get ajaxChosen to work, and there are no indications what's wrong #72

Open
chocolata opened this issue Mar 7, 2014 · 3 comments

Comments

@chocolata
Copy link

Hi

I've been tinkering all afternoon with ajaxChosen, because I love Chosen, but my option value sets are getting too large. I've also experimented with select2, but it's just too darn slow.

So, I've got the newest version of chosen (1.1.0), and the latest version of ajaxChosen. I initialize ajaxChosen as follows:

$("#add_people").ajaxChosen({
type: 'GET',
minTermLength: 3,
afterTypeDelay: 300,
dataType: 'json',
url: 'http://cmcrm.chocolata.be/content/people.php?action=list_options'
}, function (data) {
var results = [];
$.each(data, function (i, val) {
results.push({ value: val.value, text: val.text });
});
return results;
});

My script has access to this URL, and there is no XSS-prevention going on since my script is on the same domain as the remote url.

The format of my JSON is as follows:
[{"value":3,"text":"Valerietje Mortelmans (Actief)"},{"value":9,"text":"Olivier Hopchet (Actief)"},{"value":13,"text":"Wieland Rits (Actief)"},{"value":14,"text":"Melissa Seiffert van der Merwede (Actief)"},{"value":15,"text":"Guillaume de Valensart (Actief)"},{"value":18,"text":"Xavier Cloet (Actief)"},{"value":19,"text":"Brent Lammens (Actief)"},{"value":21,"text":"Coralie Libert (Actief)"},{"value":22,"text":"Laetitia Theus (Actief)"},{"value":23,"text":"Evelien Mollet (Actief)"},{"value":24,"text":"Feya Smets (Actief)"},{"value":25,"text":"Michelle Warneke (Actief)"},{"value":26,"text":"Carolyn Spaenjaers (Actief)"},{"value":27,"text":"Evelien Raes (Actief)"},{"value":28,"text":"Ange Luyten (Actief)"}]

This is what my select box looks like after initialisation:
Mensen toevoegen

    I see that chosen has initialized but when I start typing I immediately get "No search results for KEYWORD". There are no errors in my console.

    Can anyone assist so that I don't waste more time on this? :-) Would love to use this. Thanks!

    @SiR-DanieL
    Copy link

    Hi, same problem here!

    @SiR-DanieL
    Copy link

    Found the reply. Read here

    @cinder92
    Copy link

    cinder92 commented Nov 8, 2017

    @SiR-DanieL this is not working

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants