1
votes

I am using Angular UI Grid for ui-grid in my project I want to make some cells read only. cellEditableCondition(for row) and enableCellEdit (for column), I am able to achieve it. This is working fine.

But Now I want to change color of all Cells which are readonly just after page load, How can I achieve this. I understand cellEditableCondition field only execute when user click on cell in grid. any pointer also appreciated.

1
you could use ng-class directive inside your custom celltemplate and mark them disabled (css readonly and background-color)Ganesh Vellanki

1 Answers

0
votes

I used cellClass in columnDef to achieve this its working perfectly fine

cellClass: function (grid, row) {
                    if(myCondition){
                        return 'test-class1';
                    }else{
                        return 'test-class2';
                    }
                },