Forum
17:58
21/10/2010
Hi,
my problem its in a cell editing i have this code:
jQuery("#tabla_recogidas").jqGrid({
sortable: true,
url:'getRecogidasAsignacionJQGrid.json',
datatype: "json",
height: 155,
width: 750,
colNames:['<fmt:message key="recogida.fecha"/>','<fmt:message key="recogida.num.recogida"/>', '<fmt:message key="recogida.estado"/>',
'<fmt:message key="recogida.cliente"/>', '<fmt:message key="recogida.remitente"/>',
'<fmt:message key="recogida.zonaRemitente"/>', '<fmt:message key="recogida.conductor"/>'],
colModel:[ {name:'fecha',index:'fecha', width:65},
{name:'recogida',index:'recogida', width:150},
{name:'estado',index:'estado', width:65, sortable:false, search:false},
{name:'cliente',index:'cliente', width:150},
{name:'remitente',index:'remitente', width:150},
{name:'zona',index:'zona', width:150, editable:true},
{name:'conductor',index:'conductor', width:150, editable:true}],
rowNum:50,
rowTotal: ${num_total_recogidas},
scroll:1,
loadonce:false,
mtype: "POST",
rownumbers: false,
cellEdit: true,
cellsubmit: 'remote',
cellurl: 'updateRecogidasZonaConductor.json',
afterSubmitCell: function (serverStatus, rowid, cellname, value, iRow, iCol) {
var response = trim(serverStatus.responseText);
if (response != 'ok'){
$(this).restoreCell(iRow, iCol);
$("#dialog-modal").html(msgError(response));
$("#dialog-modal").dialog({
height: 140,
width: 300,
modal: true,
title: "<fmt:message key="titulo.msg"/>",
buttons: {
<fmt:message key="boton.cerrar"/>: function() {
$(this).dialog("close");
}
}
});
}
},
reloadAfterSubmit: false,
reloadAfterEdit: false,
//gridview: true,
pager: '#ptabla_recogidas',
sortname: 'fecha',
viewrecords: true,
sortorder: "asc",
caption: "<fmt:message key="recogida.tabla.datos"/>",
postData: {
manautBusq: $('#manautBusq').attr('value'), fechaBusq: $('#fechaBusq').attr('value') , recogidaBusq: $('#recogidaBusq').attr('value') , fecPrevistaRecogidaBusq: $('#fecPrevistaRecogidaBusq').attr('value') ,
clienteBusq: $('#clienteBusq').attr('value') ,
remitenteBusq: $('#remitenteBusq').attr('value') ,
zonaBusq: $('#zonaBusq').attr('value') ,
conductorBusq: $('#conductorBusq').attr('value') ,
fecrearecBusq: $('#fecrearecBusq').attr('value'),
zonaNull: $('#zonaNull').attr('checked') ,
conductorNull: $('#conductorNull').attr('checked')}
});
jQuery("#tabla_recogidas").jqGrid('navGrid',
'#ptabla_recogidas',
{del:false,add:false,edit:false},
{},
{},
{},
{multipleSearch:true});
jQuery("#tabla_recogidas").jqGrid('navButtonAdd','#ptabla_recogidas',{ caption: "<fmt:message key="tabla_datos.columnas"/>", title: "<fmt:message key="tabla_datos.reordenar.columnas"/>", onClickButton : function (){
jQuery("#tabla_recogidas").jqGrid('columnChooser'); } });
jQuery("#tabla_recogidas").jqGrid('gridResize',{minWidth:500,maxWidth:750,minHeight:255, maxHeight:355});
the first time i edit a cell everything its ok, the server response its manage by afterSubmitCell and the error its displayed in a modal dialog but in this moment if i click in a cell a submit its send to server like i press the enter key over the cell and the event fires another time... i think that its a bug because if a remove the event function the error its removed.
I apreciate any kind of help with this problem...
Thx a lot.
sortable: true,
url:'getRecogidasAsignacionJQGrid.json',
datatype: "json",
height: 155,
width: 750,
colNames:['<fmt:message key="recogida.fecha"/>','<fmt:message key="recogida.num.recogida"/>', '<fmt:message key="recogida.estado"/>',
'<fmt:message key="recogida.cliente"/>', '<fmt:message key="recogida.remitente"/>',
'<fmt:message key="recogida.zonaRemitente"/>', '<fmt:message key="recogida.conductor"/>'],
colModel:[ {name:'fecha',index:'fecha', width:65},
{name:'recogida',index:'recogida', width:150},
{name:'estado',index:'estado', width:65, sortable:false, search:false},
{name:'cliente',index:'cliente', width:150},
{name:'remitente',index:'remitente', width:150},
{name:'zona',index:'zona', width:150, editable:true},
{name:'conductor',index:'conductor', width:150, editable:true}],
rowNum:50,
rowTotal: ${num_total_recogidas},
scroll:1,
loadonce:false,
mtype: "POST",
rownumbers: false,
cellEdit: true,
cellsubmit: 'remote',
cellurl: 'updateRecogidasZonaConductor.json',
afterSubmitCell: function (serverStatus, rowid, cellname, value, iRow, iCol) {
var response = trim(serverStatus.responseText);
if (response != 'ok'){
$(this).restoreCell(iRow, iCol);
$("#dialog-modal").html(msgError(response));
$("#dialog-modal").dialog({
height: 140,
width: 300,
modal: true,
title: "<fmt:message key="titulo.msg"/>",
buttons: {
<fmt:message key="boton.cerrar"/>: function() {
$(this).dialog("close");
}
}
});
}
},
reloadAfterSubmit: false,
reloadAfterEdit: false,
//gridview: true,
pager: '#ptabla_recogidas',
sortname: 'fecha',
viewrecords: true,
sortorder: "asc",
caption: "<fmt:message key="recogida.tabla.datos"/>",
postData: {
manautBusq: $('#manautBusq').attr('value'), fechaBusq: $('#fechaBusq').attr('value') , recogidaBusq: $('#recogidaBusq').attr('value') , fecPrevistaRecogidaBusq: $('#fecPrevistaRecogidaBusq').attr('value') ,
clienteBusq: $('#clienteBusq').attr('value') ,
remitenteBusq: $('#remitenteBusq').attr('value') ,
zonaBusq: $('#zonaBusq').attr('value') ,
conductorBusq: $('#conductorBusq').attr('value') ,
fecrearecBusq: $('#fecrearecBusq').attr('value'),
zonaNull: $('#zonaNull').attr('checked') ,
conductorNull: $('#conductorNull').attr('checked')}
});
jQuery("#tabla_recogidas").jqGrid('navGrid',
'#ptabla_recogidas',
{del:false,add:false,edit:false},
{},
{},
{},
{multipleSearch:true});
jQuery("#tabla_recogidas").jqGrid('navButtonAdd','#ptabla_recogidas',{ caption: "<fmt:message key="tabla_datos.columnas"/>", title: "<fmt:message key="tabla_datos.reordenar.columnas"/>", onClickButton : function (){
jQuery("#tabla_recogidas").jqGrid('columnChooser'); } });
jQuery("#tabla_recogidas").jqGrid('gridResize',{minWidth:500,maxWidth:750,minHeight:255, maxHeight:355});
17:27
Moderators
30/10/2007
Hello,
Please Read the docs. There is important thing which you omitt - the event SHOULD return something, in your definition this is missed.
http://www.trirand.com/jqgridw.....ing#events
Regards
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.
13:33
21/10/2010
Thx a lot,
the return element solution my "no-reading" problem.
The final edition for the function is:
afterSubmitCell: function (serverStatus, rowid, cellname, value, iRow, iCol) {
var response = trim(serverStatus.responseText);
if (response == 'ok'){
return [true,""];
}else{
return [false,response];
}
}
its easy.
Thx another time.
Most Users Ever Online: 715
Currently Online:
23 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