<ejs-grid id="Grid" allowPaging="true" actionComplete="actionComplete" toolbar="@(new List<string>() { "Add","Delete","Update", "Cancel" })">
<e-data-manager url="/Home/UrlDatasource" insertUrl="/Home/Insert" updateUrl="/Home/Update" removeUrl="/Home/Remove" adaptor="UrlAdaptor"></e-data-manager>
<e-grid-editSettings allowAdding="true" allowEditing="true" allowDeleting="true" mode="Normal"></e-grid-editSettings>
<e-grid-columns>
<e-grid-column field="OrderID" headerText="Order ID" isPrimaryKey="true" width="100"></e-grid-column>
<e-grid-column field="Freight" headerText="Freight" format="C2" width="120"></e-grid-column>
<e-grid-column field="EmployeeID" headerText="Employee ID" editType="numericedit" format="C2" width="120"></e-grid-column>
</e-grid-columns>
</ejs-grid>
<script type="text/javascript">
function actionComplete(args) { // Grid actionComplete event
if (args.requestType == "beginEdit") {
args.form.querySelector("#GridFreight").addEventListener("input", function (e) { // bind the input event to Freight column input textbox
var value = parseFloat(this.value);
value = value * 10;
var numericTextBox = args.form.querySelector("#GridEmployeeID").ej2_instances[0]; // numericTextBox instance
numericTextBox.value = value; // Change the numericTextBox value with calculated value through the instance
})
}
}
</script> |
function actionComplete(args) { // Grid actionComplete event
alert(args.requestType);
if (args.requestType == "beginEdit") {
args.form.querySelector("#ConfiguracionPACGridCantidad").addEventListener("input", function (e) {
var value = parseFloat(this.value);
value = value * 10;
var CantidadNumericTextBox = args.form.querySelector("#ConfiguracionPACGridImporte").ej2_instances[0];
CantidadNumericTextBox.value = value; // Change the Importe numericTextBox value based on Cantidad
var UnitarioNumericTextBox = args.form.querySelector("#ConfiguracionPACGridValorUnitario").ej2_instances[0];
UnitarioNumericTextBox.value = value; // Change the ValorUnitario numericTextBox value based on Cantidad
})
}
} |