igGrid - validator

by georgianastasov

HTML

<script src="https://igniteui.com/js/modernizr.min.js"></script>
<script src="https://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="https://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
<script src="https://cdn-na.infragistics.com/igniteui/latest/js/infragistics.core.js"></script>
<script src="https://cdn-na.infragistics.com/igniteui/latest/js/infragistics.lob.js"></script>
<script src="https://igniteui.com/js-data/northwind"></script>
<link href="https://cdn-na.infragistics.com/igniteui/latest/css/themes/infragistics/infragistics.theme.css" rel="stylesheet"></link>
<link href="https://cdn-na.infragistics.com/igniteui/latest/css/structure/infragistics.css" rel="stylesheet"></link>

<table id="grid"></table>

JavaScript

$(function () {
						var data = [{EmployeeID: 1, FirstName: "Nancy", LastName: "Davolio", Age: 18, City: "", Address: ""}];
            
            $("#grid").igGrid({
                primaryKey: "EmployeeID",
                width: '100%',
                height: '200px',
                autoCommit: true,
                columns: [
                    { headerText: "Employee ID", key: "EmployeeID", dataType: "number", width: "15%" },
                    { headerText: "First Name", key: "FirstName", dataType: "string", width: "25%" },
                    { headerText: "Last Name", key: "LastName", dataType: "string", width: "25%"},
                    { headerText: "Age", key: "Age", dataType: "number", width: "25%"},
                    { headerText: "City", key: "City", dataType: "string", width: "25%"},
                    { headerText: "Address", key: "Address", dataType: "string", width: "25%"},
                ],
                autofitLastColumn: false,
                autoGenerateColumns: false,
                dataSource: data,
                responseDataKey: "results",
                features: [
            		{
                	name: "Updating",
                	enableAddRow: true,
                	editMode: "row",
                	enableDeleteRow: true,
                  columnSettings: [
									{
										columnKey: "FirstName", 
										editorType: "text",
										valdation: true,
										editorOptions: {
											validatorOptions:
											{
												required: {
													errorMessage: "You must enter a first name!"
												},
												custom: function (ui, fieldOptions) {
                          //the entered value
                        	console.log(ui);
                          //editor
                        	console.log($("#grid").igGridUpdating("editorForKey", "FirstName"));
                          //the validator for the editor
                        	console.log($("#grid").igGridUpdating("editorForKey",...