jQWidgets Forums

jQuery UI Widgets Forums Grid Nested Grid Cell Validation

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

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Nested Grid Cell Validation #50024

    haali
    Participant

    Hi,

    I am using jqwidget 3.0.4, and I have a one level Nested Grid. In Nested Grid I use this example:

    http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/statusbar.htm?arctic

    From using the example above, instead of Reload button, I have a Save button.

    On that Save button click I try to loop through the Nested grid data to validate each cell data.
    like below:

    function fnSaveNestedGrid(event){
    var gridId = event.originalEvent.target.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.id;
        var rows = $('#' + gridId).jqxGrid('getrows');
        for (var i = 0; i < rows.length; i++) {
            if (rows[i].FirstName == '') {
                $('#' + gridId).jqxGrid('showvalidationpopup', i, "FirstName", "Invalid Value");
            }
        }
    }

    I get this error message
    Unhandled exception at line 7, column 39218 in
    http://localhost:56287/Scripts/jqwidgets/jqxgrid.edit.js

    ‘Unable to get value of the property ‘removeClass’: object is null or undefined

    It works perfectly fine for the first level of grid.

    Thanks,
    Hassan

    Nested Grid Cell Validation #50143

    Dimitar
    Participant

    Hello Hassan,

    This issue occurs because the ids of nested grids are not explicitly set (they most probably do not have ids), while the master-grid always has one.

    To fix this, you would have to save each nested grid as it is created and then use this saved selection to call showvalidationpopup.

    If you need further assistance, please provide us with a larger code sample, including your initrowdetails function.

    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.