Click here to Skip to main content
14,879,120 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
My code is like below-

JavaScript
$("#project").autocomplete({
    minLength: 0,
    URL: ../../,
    },
    select: function (event, ui) {
        $("#project").val(ui.item.label);
        $("#project-id").val(ui.item.value);
        $("#project-description").html(ui.item.desc);
        $("#project-icon").attr("src", "images/" + ui.item.icon);

    }
})
    .data("autocomplete")._renderItem = function (ul, item) {
    return $("<li>")
        .data("item.value", item)
        .append("<a>" + item.label + "<br>" + item.desc + "</a>")
        .appendTo(ul);
};


I am getting all the data and that too in custom display( item desc is in the next line of item label). but it prevents the selection. earlier I was able to select each item but after adding the .data()._renderItem part I am not able to do so. Please suggest what's wrong in it.
Posted
Updated 1-Aug-14 20:04pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900