BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
<ej:Grid ID="OrdersGrid" runat="server" AllowPaging="True" > <ClientSideEvents CellSave="cellSave" /> . . . <EditSettings AllowEditing="True" AllowAdding="True" AllowDeleting="True"EditMode="Batch"></EditSettings> </ej:Grid> <script type="text/javascript"> function cellSave(args) { if (args.columnName == "Freight") { var newvalue = args.value;// getting the new value var oldvalue = args.rowData.Freight;// getting the old value var extra = newvalue - oldvalue;//getting the difference in value var summary = ($("td.e-summaryrow")[args.cell.index()].innerHTML).replace(/[$,]/g, "") var summaryval = (parseFloat(summary) + extra).toFixed(2); summaryval = addCommas(summaryval);//add commas to the obtained value $("td.e-summaryrow")[args.cell.index()].innerHTML = "$" + summaryval;//assigning the innerHTML of the summaryrow with updated value } }
|
<script type="text/javascript"> function cellSave(args) { if (args.columnName == "Freight") { var newvalue = args.value;// getting the new value var oldvalue = args.rowData.Freight;// getting the old value var extra = newvalue - oldvalue;//getting the difference in value for (var i = 0; i < this.model.summaryRows.length; i++) for (var j = 0; j < this.model.summaryRows[i].summaryColumns.length; j++) { if (this.model.summaryRows[i].summaryColumns[j].dataMember == "Freight" && this.model.summaryRows[i].summaryColumns[j].summaryType == "sum"){ j = i;// finding the summaryRow to be modified break; } } var summary = ($(".e-gridSummaryRows:eq(" + j + ")").find("td.e-summaryrow")[args.cell.index()].innerHTML).replace(/[$,]/g, "")// getting the summaryValue of the corresponding summaryRow var summaryval = (parseFloat(summary) + extra).toFixed(2); summaryval = addCommas(summaryval);//add commas to the obtained value $(".e-gridSummaryRows:eq(" + j + ")").find("td.e-summaryrow")[args.cell.index()].innerHTML = "$" + summaryval;//assigning the innerHTML of the summaryrow with updated value } } |