I am adding some check box filters on a HTML table, based on whether a check box is checked or not, and I am toggling rows. Is there anyway I could improve this code? There is no issue with it at the moment I could think of e.g. performance wise, but maybe someone could help me with decreasing number of lines.
HTML
<div id="RMbody" class="panel">
<div class="someRow" style="width: 100%">
<asp:CheckBox ID="cbIncludeOpen" runat="server" ClientIDMode="Static" Checked="true" onclick="RMToggle()" />
<asp:CheckBox ID="cbIncludeNew" runat="server" ClientIDMode="Static" onclick="RMToggle()" />
<asp:CheckBox ID="cbIncludeClosed" runat="server" ClientIDMode="Static" onclick="RMToggle()" />
<asp:CheckBox ID="cbIncludeRejected" runat="server" ClientIDMode="Static" onclick="RMToggle()" />
</div>
<table id="table1" class="dmctable">
<tr data-id="Open"></tr>
<tr data-id="Rejected"></tr>
<tr data-id="New"></tr>
<tr data-id="Open"></tr>
<tr data-id="Closed"></tr>
<tr data-id="Open"></tr>
<tr data-id="New"></tr>
<tr data-id="Open"></tr>
</table>
</div>
JS
function RMToggle() {
var o = $("#cbIncludeOpen").is(':checked');
var n = $("#cbIncludeNew").is(':checked');
var c = $("#cbIncludeClosed").is(':checked');
var r = $("#cbIncludeRejected").is(':checked');
if (o) { $('#table1 tr[data-id="Open"]').show(); }
else { $('#table1 tr[data-id="Open"]').hide(); }
if (n) { $('#table1 tr[data-id="New"]').show(); }
else { $('#table1 tr[data-id="New"]').hide(); }
if (c) { $('#table1 tr[data-id="Closed"]').show(); }
else { $('#table1 tr[data-id="Closed"]').hide(); }
if (r) { $('#table1 tr[data-id="Rejected"]').show(); }
else { $('#table1 tr[data-id="Rejected"]').hide(); }
}