I am using jQuery Autocomplete and MVC to populate a dropdownlist with a bunch of column names.
Whenever a user changes the value of a DropDownBox on my form I make a request to my controller to return a new list of columns (as an array, wrapped in a JSON Result) that will populate my AutoComplete boxes.
My Problem is that the autocomplete doesn't make a distinction between words and and instead insists on doing it character by c,h,a,r,a,c,t,e,r. It's very annoying. Here is the code:
function PopulateColumnsList(list) {
$(".columnDropdown").setOptions({ data: list });
}
$(document).ready(function() {
$(".columnDropdown").autocomplete("", {
width: 320,
max: 14,
highlight: false,
minChars: 0,
scroll: true,
scrollHeight: 300
});
$("#Data").change(function() {
$.ajax({
url: "/Home/ColumnNamesForDataSelect",
type: "GET",
data: { DataSelectID: parseInt($('#Data').val()) },
success: PopulateColumnsList
});
});
});
The Get Returns this response:
["Memo","Balance"]
Butmy AutoComplete will show each of these as single letters rather than two: Memo, Balance. I thought this was correct as the example code shows a similar way to return the result.
Any ideas?
Thanks in Advance.