thank you.
I saw that example but I need to make an ajax call on every keypress to build the editor array, since the array will change on every keypress.
I'm able to do that, but am not able to rebind the array to the editor. see my
?? below.
editorKeyPress: function (evt, ui) {
if (ui.dataIndx === 'mgr') {
mgrSearch = evt.originalEvent.target.value;
charC = (evt.charCode || evt.keyCode),
chr = String.fromCharCode(charC);
mgrSearch += chr
MgrSearch(mgrSearch);
}
}
function MgrSearch(mgrSearch) {
var data = { 'searchVal': mgrSearch }
$.ajax({
type: "POST",
data: JSON.stringify(data),
contentType: "application/json; charset=utf-8",
url: "Services.aspx/SearchManager",
success: function (data) {
Manager = data.d.split(",")
//?
how can I bind the Manager array at this point?
autoCompleteEditor(Manager) //this does not work
}
}
function autoCompleteEditor(source) {
return function (ui) {
ui.$cell.addClass('ui-front');//so that dropdown remains with input.
//initialize the editor
ui.$editor.autocomplete({
//appendTo: ui.$cell, //for grid in maximized state.
source: source,
position: {
collision: 'flipfit',
within: ui.$editor.closest(".pq-grid")
},
selectItem: { on: true }, //custom option
highlightText: { on: true }, //custom option
minLength: 0
}).focus(function () {
//open the autocomplete upon focus
$(this).autocomplete("search", "");
});
}
}