$('#dg').datagrid({ onBeforeEdit: function(index,row){ row.listprice = row.listprice||0; row.unitcost = row.unitcost||0; }})