Hello,
I'm update 2.2.0 script
rowData[recIndx] = data.recIndx;
, rowData['MODULID_AD'] = data.MODULID_AD;
is not work.
Thanks.
Full Update Code 2.1.0 (rowData[recIndx] = data.recIndx;), Run
/* ------------------------------------------------------------------------------------ Satır Update */
function update(rowIndx, colIndx, UpdateType) {
//debugger;
if (!$grid.pqGrid("saveEditCell")) {
return false;
}
var rowData = $grid.pqGrid("getRowData", {
rowIndx: rowIndx
});
var isValid = $grid.pqGrid("isValid", {
rowData: rowData
}).valid;
if (!isValid) {
return false;
}
var isDirty = $grid.pqGrid("isDirty");
/* ------------------------------------------------------------------------------------ Değişiklik Varmı? */
if (isDirty) {
var recIndx = $grid.pqGrid("option", "dataModel.recIndx");
var url = "<%=dosya%>?isl=GridKaydet";
if (rowData[recIndx] == null) {
url = "<%=dosya%>?isl=GridKaydet";
}
$.ajax($.extend({}, ajaxObj, {
url: url,
data: rowData,
success: function (data, textStatus, jqXHR) {
/* ------------------------------------------------------------------------------------ Hatasız Kayıt */
if (data.prkod == 0) {
$grid.pqGrid("removeClass", {
rowIndx: rowIndx,
cls: 'ui-state-error'
});
var recIndx = $grid.pqGrid("option", "dataModel.recIndx");
if (rowData[recIndx] == null) {rowData[recIndx] = data.recIndx;}
rowData['MODULID_AD'] = data.MODULID_AD;
console.log(data.MODULID_AD);
console.log(rowIndx);
//$grid.pqGrid("commit", {type: 'add',rows: rowIndx});
$grid.pqGrid("commit");
if (UpdateType=="40") {$grid.pqGrid("editCell", {rowIndx: (rowIndx + 1),colIndx: colIndx});};
if (UpdateType=="38") {$grid.pqGrid("editCell", {rowIndx: (rowIndx - 1),colIndx: colIndx});};
}
/* ------------------------------------------------------------------------------------ Hatasız Kayıt/ */
/* ------------------------------------------------------------------------------------ Hatalı Kayıt */
else {
//console.log(rowIndx);
$grid.pqGrid("addClass", {rowIndx: rowIndx,cls: 'ui-state-error'});
$grid.pqGrid("removeClass", {rowIndx: rowIndx,cls: 'pq-grid-row'});
$('<div></div>').html('Hata Kodu:' + data.prkod + '<br>' + data.prnot).dialog({
position: ['center', 'top'],
modal: true,
zindex: 9002,
title: 'Kayıt Hatası'
,close: function( event, ui ) {
$grid.pqGrid("editFirstCellInRow", {rowIndx: rowIndx});
}
});
}
/* ------------------------------------------------------------------------------------ Hatalı Kayıt/ */
},//success
/* ------------------------------------------------------------------------------------ Ajax Hata */
error: function (jqXHR, textStatus, errorThrown) {
$('<div></div>').html('Hata Kodu:' + jqXHR.status + '<br>' + jqXHR.statusText).dialog({
position: ['center', 'top'],
modal: true,
zindex: 9002,
title: textStatus
});
},//error
/* ------------------------------------------------------------------------------------ Ajax Hata/ */
//Ajax göndermeden önce
beforeSend: function (jqXHR, settings) {},
//Ajax isteği tamamlandığında
complete: function (jqXHR, textStatus) {}
}));
}
/* ------------------------------------------------------------------------------------ Değişiklik Varmı?/ */
/* ------------------------------------------------------------------------------------ Değişiklik Yoksa */
else {
$grid.pqGrid("refreshRow", {rowIndx: rowIndx});
}
/* ------------------------------------------------------------------------------------ Değişiklik Yoksa/ */
if (UpdateType=="40") {$grid.pqGrid("editCell", {rowIndx: (rowIndx + 1),colIndx: colIndx});};
if (UpdateType=="38") {$grid.pqGrid("editCell", {rowIndx: (rowIndx - 1),colIndx: colIndx});};
};//update
/* ------------------------------------------------------------------------------------ Satır Update/ */