0

The ui-grid in the code was working perfectly and suddenly started throwing

Uncaught TypeError: row.setSelected is not a function at Object.toggleRowSelection (ui-grid.js:247923) at HTMLDivElement.selectCells (ui-grid.js:248324) at HTMLDivElement.dispatch (jquery:1) at HTMLDivElement.y.handle (jquery:1)

I am registering the gridApi as below

The Grid renders fine, but on selecting any row, the above error is thrown.

    $scope.uigParticipant = {
        enableRowSelection: false,
        multiSelect: true, 
        enableRowHeaderSelection: true,
        enableColumnMenus: false,
        enableFiltering: true,
        enableSorting : true,
        treeRowHeaderAlwaysVisible: false,
        enablePaginationControls: true,
        paginationPageSizes: [25, 50, 75, 100],
        paginationPageSize: 25,
        exporterMenuCsv: true,
        exporterMenuPdf: false,
        enableGridMenu: true,
        enableAutoFitColumns: true,
        showTreeExpandNoChildren: true,
        CanUserFreezeColumns: false,
        onRegisterApi: function (gridApi) {
            $scope.gridApi = gridApi;
            gridApi.selection.on.rowSelectionChanged($scope, function (rows) {
                $scope.mySelections = gridApi.selection.getSelectedRows();
            });
        },
        columnDefs: [


        { name: 'Id', displayName: 'ID', width: '25%', headerCellClass: $scope.highlightFilteredHeader, headerCellClass: 'grid-align-center', cellClass: 'grid-align-center' },
        { name: 'Name', displayName: 'Name', width: '25%', headerCellClass: $scope.highlightFilteredHeader },

        { name: 'DOB', displayName: 'Date of Birth', type: 'date', cellFilter: 'date:"dd/MM/yyyy"', width: '25%', headerCellClass: $scope.highlightFilteredHeader, headerCellClass: 'grid-align-center', cellClass: 'grid-align-center' },
            { name: 'PhoneNo', displayName: 'Phone', width: '25%', headerCellClass: $scope.highlightFilteredHeader, headerCellClass: 'grid-align-center', cellClass: 'grid-align-center' }
            //{ name: 'Program', displayName: 'Program', width: '20%', headerCellClass: $scope.highlightFilteredHeader, headerCellClass: 'grid-align-center', cellClass: 'grid-align-center' }
        //{ name: 'RegisteredDate', displayName: 'Registered Date', width: '20%', headerCellClass: $scope.highlightFilteredHeader },
        ]
    };

Please provide some thoughts. Has there been any changes to the ui-grid-selection recently. This started happening in all the applications involving ui-grid.

1 Answer 1

0

This appears to be a known bug in 4.7.x. See https://github.com/angular-ui/ui-grid/issues/6928

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.