How to add header to a jQuery UI autocomplete

Viewed 7142

I need to add header to my autocomplete function.In this autocomplete, I am using a web method to fetch the data from database and i am using jquery-ui-1.8.16. below you can see my autocomplete function

$("#sub_Header_PropertyTab1_ucPropertyTabs_AddressTab2_txtPropertyKommunenr").autocomplete({
        source: function (request, response) {
            $.ajax({
                url: './webservices/lookup.asmx/GetKommuneAutocom',
                data: "{ 'prefixText': '" + request.term + "'}",
                dataType: "json",
                type: "POST",
                contentType: "application/json; charset=utf-8",
                success: function (data) {
                    response($.map(data.d, function (item) {
                        return {
                            label: item.split('^')[1] + "-" + item.split('^')[0],

                            val: item.split('^')[2]
                        }
                    }))
                },
                error: function (response) {
                    alert(response.responseText);
                },
                failure: function (response) {
                    alert(response.responseText);
                }
            });
        },
        select: function (e, i) {
            //            alert(i.item.label);
            $("#sub_Header_PropertyTab1_ucPropertyTabs_AddressTab2_txtPropertyKommunenr").val(i.item.val);
            //$("#").val(i.item.val);
            return false;
        },
        focus: function (e, i) {
            $("#sub_Header_PropertyTab1_ucPropertyTabs_AddressTab2_txtPropertyKommunenr").val(i.item.val);
            return false;
        },

        minLength: 1
    });
2 Answers
Related