我想将我的 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
}
});
}
但现在我不知道如何禁用此选项...感谢您的帮助!