I have a jqGrid (using inline editing) with an autocomplete column. When the user selects a value from the autocomplete column, an event handler sets a value on another col
You should rename Name
property of the items from the autocompleteSource
to value
because jQuery UI Autocomplete examines the label
and value
per default (see the documentation).
You can't use setCell
of the 'cartoon'
column which is currently in the editing mode. You should remove return false;
from select
callback too. So the code could looks about the following
dataInit: function (elem) {
$(elem).autocomplete({
source: autocompleteSource,
select: function (event, ui) {
var rowId = $("#inlineGrid").jqGrid('getGridParam', 'selrow');
if (ui.item) {
$("#inlineGrid").jqGrid('setCell', rowId, 'cartoonId',
ui.item.CartoonId);
}
}
});
}
See http://jsfiddle.net/27dLM/38/