It's not the same without you
Join the community to find out what other Atlassian users are discussing, debating and creating.
i used a html macro to display a static table. A small piece of javascript is used to highlight the rows depending on table values. this works well on the preview screen. however, in the actual view, color highlight is no where to be found. does anybody know what is going on here?
below is my code in html macro:
<html>
<head>
<script type="text/javascript">
$(document).ready(function(){
$('#report td.status').each(function(){
if ($(this).text() == 'failed')
if ($(this).text() == 'passed')
{ $(this).css('background-color','green'); }});
});
</script>
</head>
<body>
<table id="report">
<tr><th>Builds</th><th>Status</th></tr>
<tr><td>1</td><td class="status">failed</td></tr>
<tr><td>2</td><td class="status">passed</td></tr>
<tr><td>3</td><td class="status">passed</td></tr>
<tr><td>4</td><td class="status">failed</td></tr>
</table>
</body>
</html>
This alternative works. Please note –
<head>
, <body>
, or <html>
tags in the macro
<script type="text/javascript"> AJS.toInit(function(){ $('#report td.status').each(function(){ if ($(this).text() == 'failed') { AJS.$(this).css('background-color','red'); } else if (AJS.$(this).text() == 'passed') { AJS.$(this).css('background-color','green'); } }); }); </script> <table id="report"> <tr> <th>Builds</th> <th>Status</th> </tr> <tr> <td>1</td> <td class="status">failed</td> </tr> <tr> <td>2</td> <td class="status">passed</td> </tr> <tr> <td>3</td> <td class="status">passed</td> </tr> <tr> <td>4</td> <td class="status">failed</td> </tr> </table>
This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.
Read moreHi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...
Connect with like-minded Atlassian users at free events near you!
Find a groupConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.
Start an AUGYou're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.