如何根据复选框的选择重置行?我有Plnkr我必须添加选项或复选框,我可以重置字段。
$scope.gridStore.onRegisterApi = function (gridApi) {
//set gridApi on scope
$scope.gridApi = gridApi;
$scope.gridApi.edit.on.afterCellEdit($scope, function (rowEntity, colDef, newValue, oldValue) {
if (newValue != oldValue) {
rowEntity.State = true;
alert("selecetd");
}
});
};
答案 0 :(得分:0)
您可以尝试查看示例here并相应地进行更改。
$scope.gridOptions.onRegisterApi = function(gridApi) {
$scope.gridApi = gridApi;
$scope.gridApi.grid.modifyRows($scope.gridOptions.data);
$scope.gridApi.selection.selectRow($scope.gridOptions.data[0]);
var rows = $scope.gridApi.selection.getSelectedRows();
gridApi.selection.on.rowSelectionChanged($scope,function(row){
var msg = 'row selected ' + row.isSelected;
$scope.rowtobebinded=row.entity.ITEMNO;
});