jQuery UI Widgets › Forums › Grid › Validation result of cells in jqxGrid
Tagged: angular grid, grid, jquery grid, jqxgrid, programmatically, trigger validation, validate, validation
This topic contains 1 reply, has 2 voices, and was last updated by Dimitar 8 years, 10 months ago.
-
Author
-
Hi Team,
I have a question regarding the validation result of cells in jqxGrid. For example, I’ve a cell validation rule in a grid, I want to warn user and stop save action if validation result is false when I click on save button. Is there a way to get the validation result of grid in javascript? Thanks in advance.
`$scope.gridSettings = {
altrows : true,
width : ‘95%’,
sortable : false,
selectionmode : ‘multiplerowsextended’,
source : new $.jqx.dataAdapter({
url : “employees/queryEmployeesList”,
dataType : “json”,
dataFields : [ {
name : ’empId’,
type : ‘String’
}, {
name : ’empName’,
type : ‘string’
}]
}),
columnsresize : true,
columnsreorder : true,
columns : [
{
text : ‘<b>Emp ID</b>’,
dataField : ’empId’,
align : ‘center’,
editable : false,
width : ‘10%’
},
{
text : ‘<b>Name</b>’,
dataField : ’empName’,
align : ‘center’,
columntype : ‘textbox’,
width : ‘25%’,
validation : function(cell, value) {
if (value.trim().length > 41) {
return {
result : false,
message : “Name must be less than 41”
};
} else if (value.trim().length == 0) {
return {
result : false,
message : “Name is required”
};
} else if (!isAlphaNumericSpace(value)) {
return {
result : false,
message : “Employee Name allows only \’A-Z\’, \’a-z\’,\’0-9\’ and spaces”
};
}
return true;
}
} ]
};`` $scope.save = function() {
if ( gridValidated) {
save();
} else {
alert(“Please correct the input of table first”);
}
};`Hi herojj,
Please refer to the topic Trigger Validation Check on Grid Programmatically, where this question has already been discussed.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.