Next
Update
Prev
Change History
Change History (XML)

You can place restrictions on the field using JavaScript by setting the value of the itemEditEndJsFunction attribute to a JavaScript function name. This example demonstrates how to set the restrictions on the Subject column and the Length column.

Try to select GMC-1 Release2 for the value of the Subject column, the current value of which is not GMC-1 Release2.

<DataGrid ... itemEditEndJsFunction="itemEditEndFunction" ... >

function itemEditEndFunction(rowIndex, columnIndex, item, dataField, oldValue, newValue, reason) {
  if (reason == "cancelled" || reason == "sameValue")
    return null;

  if (columnIndex == 2) {
    if (newValue == "GMC-1 Release2")
      return "You cannot select GMC-1 Release2.";
    } else if (columnIndex == 5) {
      if (newValue == null || newValue == "")
        return dataField + " : You must enter a value.";
      if (isNaN(Number(newValue)))
        return dataField + " : You must enter only numbers.";
      if (newValue < 1000)
        return dataField + " : You must enter 1000 or higher values.";
    }
    
 return null;
}

© 2017 KoolChart. All rights reserved.