3

ui-grid での選択を 10 に制限したいと思いgridOptionsます。

onRegisterApi: function (gridApi) {
    $scope.gridApi = gridApi;
    gridApi.selection.on.rowSelectionChanged($scope, function (row) {
        $scope.rowsSelected = $scope.gridApi.selection.getSelectedRows();
        $scope.countRows = $scope.rowsSelected.length;
        if ($scope.countRows === 10)
        {
            // disable option to select rows now
        }
    });
}

しかし、今はこのオプションを無効にする方法がわかりません...助けてくれてありがとう!

4

1 に答える 1