Closed BorisMoore closed 4 years ago
Thank you for providing support for this.
I have an update ready that includes new checkbox group support, including a {{checkboxgroup}} tag (similar to {{radiogroup}}. However I will be travelling for the next three weeks, and unfortunately did not quite have enough time to complete testing and committing the new version (1.0.4). I expect to do so in the first week of July.
Here is my current code you can test (but with the update I will also provide new docs for checkbox groups, so you may want to wait...).
Thanks. It works.
Tested with:
<div id="result"></div>
<script id="tmpl" type="text/x-jsrender">
{^{checkboxgroup selectedCar}}
<label><input type="checkbox" value="none"/>
None</label><br/>
<label><input type="checkbox" value="volvo"/>
Volvo</label><br/>
<label><input type="checkbox" value="ford"/>
Ford</label><br/>
{{/checkboxgroup}}
<span class="spanbox" data-link="selectedCar||'none'"></span>
</script>
<script>
var tmpl = $.templates("#tmpl");
var data = {selectedCar: ["ford","volvo"]};
tmpl.link("#result", data);
</script>
This feature has been added in v1.0.4 - see https://www.jsviews.com/#jsvcheckboxgrouptag
For context, see: https://github.com/BorisMoore/jsrender/issues/350, from @wklau2006