Forum
22:19
05/10/2010
Hello. I'm trying to affect the edited data to multiply it, so if user writes 10, at the grid should have been saved 10000.
From documentation:
applies only to a cell that is editable; this event fires before validation of values if any. This event can return the new value which value can replace the edited one
beforeSaveCell : function(rowid,celname,value,iRow,iCol) {
if( some_condition )
{ return "new value"; }
}
The value will be replaced with "new value"
What am I missing? here is my code. Thanks in advance. I'm using 3.7.2
data: arrOfData,
datatype: 'local',
colNames: ['Inicio', 'Fin', 'Contrato', 'Valor'],
colModel: [
{ name: 'fch_inicio', index: 'fch_inicio', width: 155, sortable: false, sorttype: 'date', datefmt: 'Y-m-d' },
{ name: 'fch_fin', index: 'fch_fin', width: 155, sortable: false, sorttype: 'date', datefmt: 'Y-m-d' },
{ name: 'contrato', index: 'contrato', width: 90, sortable: false },
{ name: 'vr_proyectado', index: 'vr_proyectado', width: 80, align: 'right', sorttype: 'float', sortable: false, editable: true, edittype: 'text' },
],
cellEdit: true,
cellsubmit: 'clientArray',
beforeSaveCell: function (rowid, cellname, value, iRow, iCol) {
var multiplica = 1000;
return value * multiplica;
},
pager: '#pager',
rowNum: 20,
rowList: [10, 20, 30],
sortname: 'contrato',
sortorder: 'desc',
viewrecords: true,
caption: 'Caption'
});
08:06
Moderators
30/10/2007
Hello,
Thanks.
There is a bug. Fixed in GitHub.
Best 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:
40 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