vth*_*lam 1 angularjs angular-ui-grid
我正在使用Angular UI Grid,其enableRowHeaderSelection值为true.这允许用户通过单击复选框来选择行.
有没有办法根据列值禁用某些行的行选择?
这就是你要找的:http://ui-grid.info/docs/#/tutorial/210_selection
Working Plunker:http://plnkr.co/edit/vJbvJhgyKbYomW4VIsKs?p = preview
您可以使用
isRowSelectable函数来确定可选择的行.如果在网格初始化后在选项中设置此功能,则需要调用gridApi.core.notifyDataChange(uiGridConstants.dataChange.OPTIONS)以启用该选项.
$scope.gridOptions.isRowSelectable = function(row) {
if(row.entity.name === "Jack") return false;
else return true;
}
$scope.gridApi.core.notifyDataChange(uiGridConstants.dataChange.OPTIONS);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6920 次 |
| 最近记录: |