Using the cellSave inside the autocomplete from the demo. Used to update other cells in the row.
The issue I'm having is that I move to another row and update a different cell (not one with the autocomplete init) the previous values are updating on the current row. Either I'm not using cellSave correctly or I need to dispose of the cellSave? Thanks in advance for any help or advice.
function autocomp(choicedata) {
$inp.autocomplete({
selectItem: { on: true }
, source: choicedata
, select: function (event, ui) {
$("#grid_editing").pqGrid({
cellSave: function (event, uid) {
// console.log(ui);
rwindx = uid.rowIndx;
var value = ui.item.value;
var label = ui.item.label;
if (mycol === 'Location') {
var LocID = ui.item.value;
var Location = ui.item.label;
$("#grid_editing").pqGrid("updateRow", { rowIndx: rwindx, row: { "LocationID": LocID, "Location": Location } });
}
else if (mycol === 'UOMDESC') {
var UOMID = ui.item.value;
var UOMDESC = ui.item.label;
$("#grid_editing").pqGrid("updateRow", { rowIndx: rwindx, row: { "UOMID": UOMID, "UOMDESC": UOMDESC } });
}
return false;
} // END CellSave
})
},
selectItem: { on: false }, //custom option
highlightText: { on: true }, //custom option
minLength: 0
}).focus(function (event, ui) {
//open the autocomplete upon focus
$(this).autocomplete("widget").attr('style', 'max-height: 300px; overflow-y :auto; overflow-x: hidden');
$(this).autocomplete("search", "");
});