Next
Update
Prev
Change History
Change History (XML)

You can place restrictions on the field using JavaScript by setting the value of the itemFocusInJsFunction attribute to a JavaScript function name. This example demonstrates how to set the restrictions on the From column (columnIndex == 1, only capital letters are allowed), the ReceiveDate column (columnIndex == 3, the minimum year is 1920) and the CC column (columnIndex == 4, the password input type is used).

Double click on the cell which has a restriction and try to change the cell value.

<DataGrid ... itemFocusInJsFunction="itemFocusInFunction" ... >

function itemFocusInFunction(rowIndex, columnIndex, item) {
  var editor = dataGrid.itemEditorInstance;
  
  if (columnIndex == 1) {
    editor.setRestrict(/^[A-Z]+$/g);
  } else if (columnIndex == 3) {
    editor.setMinYear(1920);
  } else if (columnIndex == 4) {
    editor.setDisplayAsPassword(true);
  }
}

© 2017 KoolChart. All rights reserved.