Checked Binding not working when used with Bootstrap Checkbox

13 views
Skip to first unread message

kulkarn...@gmail.com

unread,
Mar 27, 2015, 1:57:46 AM3/27/15
to knock...@googlegroups.com
Hi All,

We are using bootstrap Checkbox and I am trying to call a Function when a checkbox is checked.  But the Checked binding is not called at all. 

Find below my current code snippet. 

In this case, $root.changeTaskStatus is function, which I want to call when the current checkbox is clicked. If I remove function() {}, then the function gets called very first time when page is loaded, but it is not triggered again. 

Any thoughts guys, how can I get this work ?


{{#foreach: groupedTasks.tomorrow}}
<li>
<div class="white-check task-check">
<input type="checkbox" value="1" name="tomorrowTask_$index" id="tomorrowTask_$index"
data-bind="checked: function(){$root.changeTaskStatus('overDue', $index, $data)}">
<label for="check08"></label>
</div>
<span>{{description}}</span>
</li>
{{/foreach}}
Reply all
Reply to author
Forward
0 new messages