{"action":"created","issue":{"url":"https://api.github.com/repos/l-lin/angular-datatables/issues/793","repository_url":"https://api.github.com/repos/l-lin/angular-datatables","labels_url":"https://api.github.com/repos/l-lin/angular-datatables/issues/793/labels{/name}","comments_url":"https://api.github.com/repos/l-lin/angular-datatables/issues/793/comments","events_url":"https://api.github.com/repos/l-lin/angular-datatables/issues/793/events","html_url":"https://github.com/l-lin/angular-datatables/issues/793","id":163943435,"number":793,"title":"[Question] is there a way to change to color of a row?","user":{"login":"NoFootDancer","id":15345906,"avatar_url":"https://avatars.githubusercontent.com/u/15345906?v=3","gravatar_id":"","url":"https://api.github.com/users/NoFootDancer","html_url":"https://github.com/NoFootDancer","followers_url":"https://api.github.com/users/NoFootDancer/followers","following_url":"https://api.github.com/users/NoFootDancer/following{/other_user}","gists_url":"https://api.github.com/users/NoFootDancer/gists{/gist_id}","starred_url":"https://api.github.com/users/NoFootDancer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NoFootDancer/subscriptions","organizations_url":"https://api.github.com/users/NoFootDancer/orgs","repos_url":"https://api.github.com/users/NoFootDancer/repos","events_url":"https://api.github.com/users/NoFootDancer/events{/privacy}","received_events_url":"https://api.github.com/users/NoFootDancer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-05T20:49:34Z","updated_at":"2016-07-05T21:16:54Z","closed_at":null,"body":"Good evening!\r\nSorry, me again. My question is simple i want to know if there's a way to change the color of a row by doing a condition.\r\n\r\nfor example i have my data as the image below:\r\n![datarow](https://cloud.githubusercontent.com/assets/15345906/16599383/db52254e-42b6-11e6-96fb-df494b06bf80.png)\r\nIs there a way i could use the \"bad_provider\" element to do a condition and if it turns out to be true i could change the row color to red?\r\n\r\nI have seen the documentation of datatables and it seems that i could do that from the createdRow method:\r\n\r\nfunction createdRow(row, data, dataIndex) {\r\n        // Recompiling so we can bind Angular directive to the DT\r\n\r\n        $compile(angular.element(row).contents())($scope);\r\n}\r\n\r\nBut i don't know how to do the condition and change the row color, is there a way to do it? or am i even approaching to this problem correctly?\r\nThanks for your attention\r\n"},"comment":{"url":"https://api.github.com/repos/l-lin/angular-datatables/issues/comments/230605808","html_url":"https://github.com/l-lin/angular-datatables/issues/793#issuecomment-230605808","issue_url":"https://api.github.com/repos/l-lin/angular-datatables/issues/793","id":230605808,"user":{"login":"NoFootDancer","id":15345906,"avatar_url":"https://avatars.githubusercontent.com/u/15345906?v=3","gravatar_id":"","url":"https://api.github.com/users/NoFootDancer","html_url":"https://github.com/NoFootDancer","followers_url":"https://api.github.com/users/NoFootDancer/followers","following_url":"https://api.github.com/users/NoFootDancer/following{/other_user}","gists_url":"https://api.github.com/users/NoFootDancer/gists{/gist_id}","starred_url":"https://api.github.com/users/NoFootDancer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NoFootDancer/subscriptions","organizations_url":"https://api.github.com/users/NoFootDancer/orgs","repos_url":"https://api.github.com/users/NoFootDancer/repos","events_url":"https://api.github.com/users/NoFootDancer/events{/privacy}","received_events_url":"https://api.github.com/users/NoFootDancer/received_events","type":"User","site_admin":false},"created_at":"2016-07-05T21:16:54Z","updated_at":"2016-07-05T21:16:54Z","body":"Nevermind i founded the solution by myself:\r\n\r\nfunction createdRow(row, data, dataIndex) {\r\n        // Recompiling so we can bind Angular directive to the DT\r\n        if(data.bad_provider === true){\r\n        \t$('td', row).addClass('danger');\r\n        }\r\n        $compile(angular.element(row).contents())($scope);\r\n}\r\n\r\nInside createdRow function just add the condition you want to make and then the changes in it, pretty simple.\r\n"}}
{"actor":{"display_login":"NoFootDancer"}}