KavyaVS
asked on
isRowSelectable function is not working after factory call
Hi,
I am using Angular uigrid 3.2.8 in my angular js application. Grid using the ui-grid-selection directive to row selection. I selected few rows with row column state as Submitted. In the submitApprovedRows method I am getting all the selected rows and making a call to Factory to submit selectedrowinfo to RestApi service and there in the factory method I am changing the State from Submitted to Approved and returning from factory. Then I am using isRowSelectable function to determine which rows are selectable. I want to disable the row selection for all the rows with State as Approved. But it is not working.Row is undefined in isRowSelectable method. But I tested and found that isRowSelectable working fine if I don't make a call to factory call. So It has everything all the dependencies properly included. But after factory call isRowSelectale function not working .Any suggestion please. Thanks.
Please see the code given below.
I am using Angular uigrid 3.2.8 in my angular js application. Grid using the ui-grid-selection directive to row selection. I selected few rows with row column state as Submitted. In the submitApprovedRows method I am getting all the selected rows and making a call to Factory to submit selectedrowinfo to RestApi service and there in the factory method I am changing the State from Submitted to Approved and returning from factory. Then I am using isRowSelectable function to determine which rows are selectable. I want to disable the row selection for all the rows with State as Approved. But it is not working.Row is undefined in isRowSelectable method. But I tested and found that isRowSelectable working fine if I don't make a call to factory call. So It has everything all the dependencies properly included. But after factory call isRowSelectale function not working .Any suggestion please. Thanks.
Please see the code given below.
$scope.submitApprovedRows = function() {
$scope.selectedGridRows = $scope.gridApi.selection.getSelectedRows();
CRFactory.submitApprovedRowsInfo($scope);
$scope.gridApi.selection.clearSelectedRows();
$scope.gridOptions.isRowSelectable = function(row) {
if(row.entity.State == "Approved") {
return false;
}else {
return true;
}
};
$scope.gridApi.core.notifyDataChange(uiGridContants.dataChange.OPTIONS);
};
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER