function setAutoComplete() {
var columns = ["GALACXY_ID", "CONTACT_POINT", "LOCATION", "CONFIRMED_LOC", "ASSOCIATED_TO", "OLD_ASSET_TAG", "TX_ITEMS_ASSET_TAG"];
for (i = 0; i < columns.length; i++) {
$('#' + columns[i]).focus(
function () {
var controlitem;
if (ArrayIndexOf(columns, $(this).attr("ID")) > -1)
controlitem = $(this);
else
controlitem = $('#' + columns[i]);
if (controlitem.attr("ACDONE") == "Y") {
}
else {
controlitem.attr("ACDONE", "Y");
//$('#LOCATION').unautocomplete();
controlitem.autocomplete('/ASSET/Lookup', { //<%= Url.Action("Lookup", "ASSET") %>
dataType: 'json',
parse: function (data) {
var rows = new Array();
if (data != null) {
for (var i = 0; i < data.length; i++) {
rows[i] = { data: data[i], value: data[i].ID, result: data[i].ID };
}
}
return rows;
},
formatItem: function (row, i, n) {
return row.ID + ' - ' + row.TEXT;
},
width: 500,
height: 500,
//mustMatch: true, ////mustMatch: true,
extraParams: {
Field: function () { return controlitem.attr("ID"); },
//OldValue: function () { return $("#LOCATION").attr("OldValue"); }
OldValue: function () { return controlitem.val(); },
CHECK_IN_OUT_LOCATION: function () { return $("#CHECK_IN_OUT_LOCATION").val(); }
}
})
}
}
);
}
|