Hi I have a grid with inline editing and noticed that what was working correctly under 2.0.4 now doesn't under 2.3.0. - my update function is
function update(rowIndx, $grid) {
if (!$grid.pqGrid("saveEditCell")) {
return false;
}
var rowData = $grid.pqGrid("getRowData", { rowIndx: rowIndx }),
recIndx = $grid.pqGrid("option", "dataModel.recIndx"),
type;
var isValid = $grid.pqGrid("isValid", { rowData: rowData }).valid;
if (!isValid) {
return false;
}
var isDirty = $grid.pqGrid("isDirty");
if (isDirty) {
if (rowData[recIndx] == null) {
//add record.
type = 'add';
}
else {
//update record.
type = 'update';
}
$grid.removeClass({ rowIndx: rowIndx, cls: 'pq-row-edit' });
$grid.commit({ type: type, rows: [rowData] });
$grid.refreshRow({ rowIndx: rowIndx });
}
else {
$grid.quitEditMode();
$grid.removeClass({ rowIndx: rowIndx, cls: 'pq-row-edit' });
$grid.refreshRow({ rowIndx: rowIndx });
}
}
This statement always fails
if (!$grid.pqGrid("saveEditCell")) {
return false;
}
and if I bypass all appears to work but get left with display of Update, Cancel buttons rather than Edit, Delete
Any ideas?