I'm trying to use jQuery UI Autocomplete inside a jqGrid in the dataInit
. I'm doing it like this:
{ name:'ac_fin_g', index:'ac_fin_g', width:75, editable: true, edittype: 'text',
editoptions: {
dataInit: function (elem) {
$(elem).autocomplete({
source: 'autocomplete.php',
select: function (event, ui) {
#('ac_fin_g').val(ui.item.value);
}
});
}
}}
And in the function ondblClickRow
I'm passing select
like a parameter:
ondblClickRow: function (id, select) {
if (id) {
if (id !== lastSel) {
$('#list').restoreRow (lastSel);
$('#list').editRow (id, true, select);
lastSel = id;
} else {
$('#list').restoreRow (lastSel);
lastSel = "";
}
}
}
This is working but just for the first row.