Hi,
I’m using Jqxgrid, where i have Quantity, UnitPrice & TotalPrice, columns.
on editing quantity col, i want to use ‘OnChange’ event to effect the value in TotalPrice col.
I tried using oncellendedit, but by using this, when user change the of quantity col, it is not changing/effect the TotalPrice col value. User have
to click out the quantity col then it is changing/effecting the value in TotalPrice.
But i’m looking for the ‘onchange’ event, so, as soon as, user change value it should simultaneously effect the totalprice col value.
Please help me
$("#jqxgrid").on('cellendedit', function (event) {
var args = event.args;
var columnDataField = args.datafield;
var rowIndex = args.rowindex;
var cellValue = args.value;
var oldValue = args.oldvalue;
//alert('b4 calc');
if (columnDataField == "Quantity") {
//alert('InCal');
var qty = cellValue;
var updateTP = null;
var UP = $("#jqxgrid").jqxGrid('getcellvalue', rowIndex, 'UnitPrice');
if (qty != null) {
//alert('Qty: ' + qty + ',UP: ' + UP);
updateTP = qty * UP;
$("#jqxgrid").jqxGrid('setcellvalue', rowIndex, 'TotalPrice', updateTP);
UpdateDataToSave();
}
}
});