Forum


01:36

02/10/2008

Someone can explain why it does not work highlighted in bold (the saveRow). I do not get a single message (alert):
$(document).ready(function(){
var mygrid = jQuery("#list").jqGrid({
url:'registrar_pagos_data.php',
datatype: 'xml',
mtype: 'GET',
colNames:['Alumno','Cuota a Imputar', 'Monto', 'Fecha', 'Cant. Cuotas', 'Pago', 'Id'],
colModel :[
{name:'alumno', index:'alumno', width:450, editable:false},
{name:'cuota', index:'cuota', width:120, align:'center', editable:false},
{name:'monto', index:'monto', width:80, align:'right', editable:true, sortable: true, formatter:'currency', formatoptions:{prefix:"$"}},
{name:'fecha', index:'fecha', width:60, editable:true, sortable: false, editoptions:{dataInit:function(campo) { $(campo).dateEntry({dateFormat:'dmy/'}); }}},
{name:'cant_cuotas', index:'cant_cuotas', width:80, align:'right', editable:true, sortable: false,formatter:'integer'},
{name:'pago', index:'pago', width:80, align:'center', editable:true, sortable: false, edittype:"checkbox", formatter:'checkbox', formatoptions: {disabled:false}},
{name:'id', index:'id', width:80, hidden:true, align:'right', editable:true, sortable: false,formatter:'integer'}
],
pager: '#pager',
rowNum:30,
rowList:[30,60,90,120,150,200,300],
sortname: 'alumno',
sortorder: 'asc',
viewrecords: true,
height: '300px',
editurl:"registrar_pagos_save.php",
caption: 'Gestión de Pagos',
forceFit: true,
cellEdit: true,
cellsubmit: 'clientArray',
afterSaveCell : function(rowid,name,val,iRow,iCol) {
var monto_completo = (jQuery("#list").jqGrid('getCell', rowid, 2) > 0);
var fecha_completa = (jQuery("#list").jqGrid('getCell', rowid, 3) > '');
var cant_cuotas_completa = (jQuery("#list").jqGrid('getCell', rowid, 4) > 0);
if (monto_completo && fecha_completa && cant_cuotas_completa) {
$("#list").jqGrid('setRowData',rowid,{pago:true});
}
else {
$("#list").jqGrid('setRowData',rowid,{pago:false});
}
}
});
jQuery("#list").jqGrid('navGrid','#pager',
{view:false, edit:false, add:false, del:false, search:false, refresh:false},
{}, // edit options
{}, //Add Options
{}, //Del Options
{},
{} // view options //Search Options
);
jQuery("#list").jqGrid('navButtonAdd',"#pager",{caption:"Guardar",title:"Guarda los Cambios Marcados", buttonicon :'ui-icon-disk',
onClickButton:function() {
$("#list").jqGrid('saveRow', '256',
function() {
alert('Todo bien');
},
'registrar_pagos_save.php',
{},
function(rowid, respuesta) {
alert('respuesta');
},
function (rowid, respuesta) {
alert('respuesta2');
}
);
Thank you very much.
Martín
17:44

Moderators
30/10/2007

Hello,
saveRow work only if the row is edited.
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
71 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66