0

I'm trying to hide/remove certain rows if they have a specific ng-class or if some boolean function returns true or false

I tried using rowTemplate with ng-class or ng-show/ ng-hide but this results in empty rows instead of removing the rows all together.

Note that I can't use filterText because my boolean function compares different cells to come to decision whether each row will be hidden/removed or not.

I've searched quite a bit and couldn't find anything, would appreciate if anyone has a solution to the above.

The following thread experiences a similar issue: How to get ng-grid to hide certain rows

Community
  • 1
  • 1
kkudi
  • 1,625
  • 4
  • 25
  • 47

1 Answers1

0

Could you use ng-show / ng-hide based on a boolean from your model?

These directives work by setting the element styles to display:block to show and display:none to hide as appropriate. They provide equivalent but inverse functionality for showing and hiding based on the expression you pass to them.

Paul Whelan
  • 16,574
  • 12
  • 50
  • 83
  • I have used that, but it doesn't work. It still displays the row but without any data within it. – kkudi Nov 06 '13 at 10:21
  • Did you place them on the ? EDIT: Sorry I see you are using ng-grid – Paul Whelan Nov 06 '13 at 10:22
  • The rowTemplate looks like this: $scope.rowTemplate = '
    ' + '
    ' + '
    ' + '
    ' . Not sure I can see a tr in there
    – kkudi Nov 06 '13 at 10:24
  • @kkudi Yes sorry just new to angular myself I just read the example in the o reilly book this morning to show hide based on model data. I'm not familiar yet with ng-grid to help out there. – Paul Whelan Nov 06 '13 at 10:28