草庐IT

php - jqGrid setCell计算值

我需要使用jqGrid和PHP开发一个网格,它有4列:Product、Quantity、Price和Amount。从数据库中检索产品名称。如果用户编辑Quantity和Price列,amount单元格应通过乘以Quantity和Price列自动更改。我试过如下:vargrid=$("#reportTable");........afterSaveCell:function(rowid,name,val,iRow,iCol){grid.jqGrid("setCell",rowid,"amount",val,"");calculateTotal();}请注意,calculateTotal(