Monday, December 7, 2015

How to populate extra fields with jQuery autocomplete

How to populate extra fields with jQuery autocomplete

                source: function (request, response) {
                    $.ajax({
                        url: requestUrl,
                        dataType: "json",
                        data: { query: request.term },
                        success: function (data) {
                            response($.map(data, function (item) {
                                return {
                                    label: item.Name,
                                    value: item.Name,
                                    realValue: item.UID,
                                    lastPrice: item.LastPrice,
                                };
                            }));
                        },
                    });
                },

Reference:

http://stackoverflow.com/questions/21146589/how-to-populate-extra-fields-with-jquery-autocomplete

No comments: