I\'m having trouble implementing autocomplete in jqgrid. I\'ve walked researching, alias until I based this question on a site that currently do not meet. The problem is thi
First of all you don't need to use edittype : 'custom'
to be able to use jQuery UI Autocomplete. Instead of that you can use just dataInit
.
You can define myAutocomplete
function for example like
function myAutocomplete(elem, url) {
setTimeout(function () {
$(elem).autocomplete({
source: url,
minLength: 2,
select: function (event, ui) {
$(elem).val(ui.item.value);
$(elem).trigger('change');
}
});
}, 50);
}
and then use
{ name:'COD_OBJ_EST', hidden: true, editable: true,
editoptions: {
dataInit: function (elem) {
myAutocomplete(elem, "autocomplete.php?id=estrategico");
}
}}
Be careful that the name of parameter which will be send to the server is the standard name term
instead of the name q
which you currently use. I personally don't see any need to change the default name of the parameter.