jQuery UI Widgets Forums Grid Validation result of cells in jqxGrid

This topic contains 1 reply, has 2 voices, and was last updated by  Dimitar 8 years, 10 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Validation result of cells in jqxGrid #78319

    herojj
    Participant

    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”);
    }
    };`

    Validation result of cells in jqxGrid #78344

    Dimitar
    Participant

    Hi herojj,

    Please refer to the topic Trigger Validation Check on Grid Programmatically, where this question has already been discussed.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.