I need to develop a grid using jqGrid and PHP what has 4 columns: Product, Quantity, Price and Amount. The product name is retrieved from the database. If the user edits the Quantity and Price columns, the amount cell should be changed automatically by multiplying the Quantity and Price columns. I've tried as follows:
var grid = $("#reportTable");
........
afterSaveCell: function (rowid, name, val, iRow, iCol) {
grid.jqGrid("setCell", rowid, "amount", val, "");
calculateTotal();
}
Please note that the calculateTotal() can calculate well the grand summary of the Quantity column without any error, and can show on the footer of the grid perfectly.