bseth99/jquery-ui-multisearch

external json

nobutsta opened this issue · 3 comments

Hello,
Is it possible to change from localData = []; into something like $.getJSON( "ajax/test.json", function( data ) {});

Yes, look at the docs (http://bseth99.github.io/jquery-ui-multisearch/index.html) for the source and ajaxOptions config options to setup a remote datasource

I've looked in it but it's not work. Here is what I did.

        $('#multisearch').multisearch({
            ajaxOptions: {
                searchTerm: 'inc/phonebook.json.php',
                dataType: 'json',
                method: 'GET'
            }
        });

Please suggest.

The URL needs to be in the source options:

    $('#multisearch').multisearch({
        source:  'inc/phonebook.json.php',
        ajaxOptions: {
            searchTerm: 'name',  /* or whatever your php script is expecting */
            dataType: 'json',
            method: 'GET'
        }
    });

That, in theory, should work.