Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This is PrimeFaces bug in <strong>treetable.js</strong>, <a href="https://code.google.com/p/primefaces/issues/detail?id=6007" rel="nofollow">there is issue</a>.</p> <p>The problem is because <em>unselectAllNodes()</em> function in <strong>treetable.js</strong> does not clear <strong>selection</strong> array variable but it should be empty after exit from this function:</p> <pre><code>unselectAllNodes: function() { var selectedNodes = this.tbody.children('tr.ui-state-highlight'); for(var i = 0; i &lt; selectedNodes.length; i++) { this.unselectNode(selectedNodes.eq(i), true); } } </code></pre> <p>When parent row with previous selected row is expanded this bug not occur, because all visible selected rows (search by <em>ui-state-highlight</em> attribute) unselects with removing from <strong>selection</strong> array variable. But when parent row is collapsed, tbody.children*('tr.ui-state-highlight')* return empty list, and <strong>selection</strong> array variable have previous value plus new selectable value separated by comma.</p> <p>Good news that from PrimeFaces 4.0 release this bug was fixed. because <a href="https://code.google.com/p/primefaces/source/diff?spec=svn10078&amp;r=10078&amp;format=side&amp;path=/primefaces/trunk/src/main/resources/META-INF/resources/primefaces/treetable/treetable.js&amp;old_path=/primefaces/trunk/src/main/resources/META-INF/resources/primefaces/treetable/treetable.js&amp;old=10076" rel="nofollow">this commit</a> have been inluded to release. One small difference: <strong>selection</strong> array variable have been renamed to <strong>selections</strong> by other commits.</p> <pre><code>unselectAllNodes: function() { var selectedNodes = this.tbody.children('tr.ui-state-highlight'); for(var i = 0; i &lt; selectedNodes.length; i++) { this.unselectNode(selectedNodes.eq(i), true); } this.selections = []; this.writeSelections(); } </code></pre>
 

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