Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Your first issue is mainly due to the interaction with kendo. The selector <code>"input.cbSelect"</code> is not correct, since you are replacing the original checkboxes with label-only ones. So actually you are clicking on the label and not on the checkbox itself. The correct one would be <code>"li label span"</code> but even then it wouldn't work because you cannot prevent kendo from selecting the panel.</p> <p>Even</p> <pre><code>$("#panelbar").on("click", "label span", function(evt) { evt.stopImmediatePropagation(); return false; }) </code></pre> <p>wouldn't prevent the kendo selection.</p> <p>But what you actually can do is unbinding the child from the parent with a html action, so the kendo handler doesn't trigger:</p> <p><strong>Solution:</strong></p> <p>In your template replace</p> <pre><code>&lt;span id='cbSelect" + x + "'&gt;&lt;/span&gt; </code></pre> <p>with</p> <pre><code>&lt;a href="#" id='cbSelect" + x + "'&gt;&lt;/a&gt; </code></pre> <p>and in your input css the <code>span</code> with <code>a</code>.</p> <p>The a-Element triggers a seperate action, so now you can stop the kendo Handler with</p> <pre><code>$("#panelbar").on("click", "label a", function(evt) { evt.stopImmediatePropagation(); }); </code></pre> <p>The problem now is, that the checking of the checkbox by clicking on the label also doesn't work. So we have to do this manually by extending the handler above:</p> <pre><code>$("#panelbar").on("click", "label a", function(evt) { var chkbx = $(this).closest('li').find('input'); chkbx.prop('checked', !chkbx.prop('checked')); evt.stopImmediatePropagation(); }) </code></pre> <p><strong>Working example:</strong><br> <a href="http://jsfiddle.net/Nitro3k/5nX8r/47/" rel="nofollow">http://jsfiddle.net/Nitro3k/5nX8r/47/</a></p> <p><strong>Alternative:</strong></p> <p>If you do not want the link inside the label, you can also:</p> <ol> <li>remove the span completely, style the label directly instead and call <code>return false;</code> instead of <code>evt.stopImmediatePropagation();</code></li> <li>build a custom checkbox, since you have to trigger it with <code>js</code> anyway:</li> </ol> <p>Remove the lable, style a block instead (e.g <code>.checkbox</code>) together with a checked class (e.g. <code>.checkbox.checked</code>). Build the block around the checkbox:</p> <pre><code>&lt;div class="checkbox"&gt;&lt;input type='checkbox' id='c1' class='cbSelect' /&gt;&lt;/div&gt; </code></pre> <p>and add the handler:</p> <pre><code>$(document).on('click', '.checkbox', function(){ var chkbx = $(this).find('input'); chkbx.prop('checked', !chkbx.prop('checked')); $(this).toggleClass('checked'); }) </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload