Calculate two column values in editing DataGrid

Tutorial » Calculate two column values in editing DataGrid

In this tutorial you will learn how to include a calculated column in a editing datagrid. A calculated column generally contains some value calculated from one or more other columns.

View Demo

First, create the editable datagrid. Here we create some editable columns, the 'listprice','amount' and 'unitcost' columns are defined as numberbox editing type. The calculated column is 'unitcost' field that will be the result of multiplying listprice times amount.

Now we begin an editing action when user click a row.

To build the calculated relationship between some columns, we should get the current editors and bind some events for them.

Download the EasyUI example:

easyui-datagrid-demo.zip