I am trying to make a radio-button filter that changes its background color when it's selected. Right now it looks like this:
<div data-bind="visible: applications().length > 0">
<label>Filter: </label>
<label class="radio-inline">
<input type="radio" value="new" data-bind="checked: applicationsFilter, css: {selected: applicationsFilter}" class="" />
New / Pending Review
(<span data-bind="text: newApplicationsCount"></span>)
</label>
<label class="radio-inline">
<input type="radio" value="shortlisted" data-bind="checked: applicationsFilter, css: {selected: applicationsFilter}" />
Shortlisted
(<span data-bind="text: shortlistedApplicationsCount"></span>)
</label>
<label class="radio-inline">
<input type="radio" value="connected" data-bind="checked: applicationsFilter, css: {selected: applicationsFilter}}" />
Connected
(<span data-bind="text: connectedApplicationsCount"></span>)
</label>
<label class="radio-inline">
<input type="radio" value="all" data-bind="checked: applicationsFilter, css: {selected: applicationsFilter}" />
All
(<span data-bind="text: allApplicationsCount"></span>)
</label>
<label class="radio-inline" data-bind="visible: applications().length > 0">
<input type="checkbox" data-bind="checked: showHiddenApplications" />
Include Hidden
</label>
</div>
My intention was to apply the .selected class when the radio-button is selected by doing
data-bind="checked: applicationsFilter, css: {selected: applicationsFilter}}
But the output does not actually apply the css style. What is the proper way of doing this?
Thanks