var grid = new ej.grids.Grid({
dataSource: window.orderDataSource,
editSettings: { allowEditing: true, allowAdding: true, allowDeleting: true, mode: 'Normal', newRowPosition:'Top' },
allowPaging: true,
pageSettings: { pageCount: 5 },
toolbar: ['Add', 'Edit', 'Delete', 'Update', 'Cancel'],
columns: [
{
field: 'OrderID', isPrimaryKey: true, headerText: 'Order ID', textAlign: 'Right',
validationRules: { required: true, number: true }, width: 140
},
{
field: 'CustomerID', headerText: 'Customer ID',
validationRules:{required:true,minLength:[checkMaxHours,'Este campo es obligatorio']}, width: 100
},
. . .
],
});
grid.appendTo('#Grid');
function checkMaxHours(args){
var row = grid.getRowObjectFromUID(ej.base.closest(args.element, '.e-row').getAttribute('data-uid'));
console.log(row.data);
return true;
} |