Maslosoft Binder Logo Maslosoft Binder Documentation
Knockout JS tracker and binding handlers with coffee and sugar

Hidden

Hidden binding handler is opposite to built into knockout JS visible binding. This will hide element when value evaluates to true.


Hidden if checked
Visible if checked

Relevant code used in examples:

<div>
	<label>
		<input type="checkbox" data-bind="checked: binder.model.Hidden.show, checkedValue: true, uncheckValue: false" value="0" />
		Check to show
	</label>
	<br />
	<div data-bind="hidden: binder.model.Hidden.show">Hidden if checked</div>
	<div data-bind="visible: binder.model.Hidden.show">Visible if checked</div>
</div>

<script>
	window.onload = (function(){­
		binder.model.Hidden = new Maslosoft.Koe.Hidden({­show: true­});
		ko.applyBindings({­model: binder.model­}, document.getElementById('ko-binder'));
	­});
</script>