ui-grid icon indicating copy to clipboard operation
ui-grid copied to clipboard

ng-disabled not update after sorting process ui-grid - cell template

Open sirajudeen013 opened this issue 9 years ago • 1 comments

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

sirajudeen013 avatar Sep 18 '17 16:09 sirajudeen013

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.

sirajudeen013 avatar Sep 19 '17 05:09 sirajudeen013