Andy Green
asked on
Remove background colour of row with a checkbox contained in it
Hi
This mess of code is generated by a Grid control:
You will see I have a row - contained in this row is a Checked checkbox with the class ID of primaryProc.
What I want to do is remove the background colour of this row.
Here is what I have at the moment but it doesn't work:
Andy
This mess of code is generated by a Grid control:
<tr class="rgAltRow" style.backgroundColor="this.originalstyle=this.style.backgroundColor;this.style.backgroundColor='#FDC179'" id="rpbOutcomes_i0_rgProcedures_ctl00__1" style="background-color:#FFD666;">
<td class="rgGroupCol"> </td><td style="display:none;">143</td><td style="display:none;"> </td><td valign="top">Urodynamics (with catheter)</td><td align="center" valign="top">7B2B7</td><td align="center" valign="top">M47.4</td><td align="center">
<span style="display: none"><input id="rpbOutcomes_i0_rgProcedures_ctl00_ctl07_chkLeft" type="checkbox" name="rpbOutcomes$i0$rgProcedures$ctl00$ctl07$chkLeft" /><label for="rpbOutcomes_i0_rgProcedures_ctl00_ctl07_chkLeft">L</label></span>
<span style="display: none"><input id="rpbOutcomes_i0_rgProcedures_ctl00_ctl07_chkRight" type="checkbox" name="rpbOutcomes$i0$rgProcedures$ctl00$ctl07$chkRight" /><label for="rpbOutcomes_i0_rgProcedures_ctl00_ctl07_chkRight">R</label></span>
</td><td align="center">
<span id="rpbOutcomes_i0_rgProcedures_ctl00_ctl07_txtSite_wrapper" class="riSingle RadInput RadInput_Default" style="width:80px;"><input id="rpbOutcomes_i0_rgProcedures_ctl00_ctl07_txtSite" name="rpbOutcomes$i0$rgProcedures$ctl00$ctl07$txtSite" size="20" maxlength="50" class="riTextBox riEnabled" type="text" value="" /><input id="rpbOutcomes_i0_rgProcedures_ctl00_ctl07_txtSite_ClientState" name="rpbOutcomes_i0_rgProcedures_ctl00_ctl07_txtSite_ClientState" type="hidden" /></span>
</td><td align="center">
<span class="primaryProc"><input id="rpbOutcomes_i0_rgProcedures_ctl00_ctl07_chkPrimary" type="checkbox" name="rpbOutcomes$i0$rgProcedures$ctl00$ctl07$chkPrimary" checked="checked" onclick="setPrimaryProcedure(this);" /></span>
</td><td align="center">
<input id="rpbOutcomes_i0_rgProcedures_ctl00_ctl07_chkSecondary" type="checkbox" name="rpbOutcomes$i0$rgProcedures$ctl00$ctl07$chkSecondary" onclick="setSecondaryProcedure(this);" />
</td>
</tr>
You will see I have a row - contained in this row is a Checked checkbox with the class ID of primaryProc.
What I want to do is remove the background colour of this row.
Here is what I have at the moment but it doesn't work:
$(".primaryProc").style.backgroundColor = "#fff"
I have also tried removing the colour attribute and used "" instead.Andy
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi
I have this working after a fashion. By changing my code to this:
$(".primaryProc").parent() .parent(). css('backg round-colo r','#fff') ;
Is there a more elegant solution than .Parent().Parent().
Thank you jayakrishnabh for the correct syntax for applying the style.
Andy
I have this working after a fashion. By changing my code to this:
$(".primaryProc").parent()
Is there a more elegant solution than .Parent().Parent().
Thank you jayakrishnabh for the correct syntax for applying the style.
Andy
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks Guys. I have halved the points. Hope that's OK with you both.
Andy
Andy
ASKER
This can't be hard coded, its got to work for any row in the table.
However there will only ever be 1 row at a time with a checkbox with the primaryProc class.
Andy