ng-disabled not update after sorting process ui-grid - cell template
Hi team, I faced issue when try to disabled button using cellTemplate on columnDefs. Initially the it works fine based on the flag 'ReadOnly', but after sorting process, the action column not updated with new value. FYI, I have used default internal sorting only not server side.
I used the following code,
{ field: 'action', displayName: 'Actions', enableSorting: false, width:165, cellTemplate:'<button class="btn btn-primary btn-sm" ng-click="grid.appScope.deleteSavedQuery(row)" ng-disabled="{{row.entity.ReadOnly}}" title="Delete">' }
I tried without curly braces, but not working at the initial time itself. Please help me to resolve it. Thank you
Hi Team, I got the solution, instead of using ng-disabled with expression, I have used ng-class like below,
ng-class="grid.appScope.getClassForReadOnly(row.entity.ReadOnly)"
$scope..getClassForReadOnly = function(readOnlyFlag){ if(readOnlyFlag == 'true'){ return 'disabled'; }else{ retunr ''; } }
Thank You.