jQuery UI Widgets Forums Editors Input, Password Input, TextArea, ColorPicker, Rating, TagCloud, Loader Multiple Values | Get response from server-side base on input value

This topic contains 1 reply, has 2 voices, and was last updated by  Hristo 8 years, 1 month ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author

  • raj
    Participant

    Hi,

    Is it possible to achieve Multiple values input similar to Auto Complete?

    Meaning: send a query to server and get a response based on the keyed-in values each time.

    For example:

    $("#input").jqxInput({ placeHolder: "Enter a City", height: 25, width: 200, 
                        source: function (query, response) {
                            var dataAdapter = new $.jqx.dataAdapter
                            (
                                {
                                    datatype: "jsonp",
                                    datafields:
                                    [
                                        { name: 'countryName' }, { name: 'name' },
                                        { name: 'population', type: 'float' },
                                        { name: 'continentCode' },
                                        { name: 'adminName1' }
                                    ],
                                    url: "http://api.geonames.org/searchJSON",
                                    data:
                                    {
                                        featureClass: "P",
                                        style: "full",
                                        maxRows: 12,
                                        username: "jqwidgets"
                                    }
                                },
                                {
                                    autoBind: true,
                                    formatData: function (data) {
                                        data.name_startsWith = query;
                                        return data;
                                    },
                                    loadComplete: function (data) {
                                        if (data.geonames.length > 0) {
                                            response($.map(data.geonames, function (item) {
                                                return {
                                                    label: item.name + (item.adminName1 ? ", " + item.adminName1 : "") + ", " + item.countryName,
                                                    value: item.name
                                                }
                                            }));
                                        }
                                    }
                                }
                            );
                        }
                    });

    Looking forward.

    Thanks & Regards,
    Senthil


    Hristo
    Participant

    Hello raj,

    Please, take a look at this example:
    http://jsfiddle.net/jqwidgets/BcYMU/

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.