updated rowTemplate example
I've been trying to work with the rowTemplate example and the current grid code (I believe some of the 2.0.x changes have broken it), but can't get it to work
This plunkr
http://plnkr.co/edit/nXBb7sPLkYhmE5N6Q7P6?p=preview
is a copy of the row template plunkr linked where I've copied in the rowTemplate partial from the current source, and attempted to merge in the conditional class setting, but I think the two ng-class directives are fighting. Can someone who knows more about Angular or the grid help me out here?
thanks!
Doen't appear multiple expressions are doable right now, but a fix would be to move the first ng-class to the class attribute. YMMV
var rowTempl = '<div ng-style="{ \'cursor\': row.cursor }" '+
'ng-repeat="col in renderedColumns" '+
'ng-class="{green: row.getProperty(\'age\') < 30}"' +
'class="ngCell {{col.cellClass}} {{col.colIndex()}}" ng-cell></div>';
Thanks, that appears to work fine for me. I appreciate the help.
Can I mark this issue as FAQ/documentation? Or does that need to be an admin.
Could someone update the plunkr link from the examples page?
This is an angular limitation, you can't have multiple ng-class tags in a div
Ng-class supports multiple expressions , ng-grid has its ng-class on the row in such a way the multiple expressions break the grid. I'm not sure why ng-class is being used , which is why I moved that class in my example solution.