title: Bootstrap treeview Select children on root click
body: <p>i am using Bootstrap Treeview (bootstrap-treeview.js v1.0.2);
  how can i activate selection effect on all chidren of root node on click of root? </p>
  
  <p>This snippet doesn't work as expected</p>
  
  <pre><code>$('#tree')
      .on('nodeSelected', function (event, node) {
          children=node['nodes'];
          for (var i = 0; i &lt; children.length; i++) {
              children[i].states.expanded = true;
              children[i].states.selected = true;
          }
  });
  </code></pre>
  
  <p>and this works only on the first child</p>
  
  <pre><code>$('#tree')
      .on('nodeSelected', function (event, node) {
          children=node['nodes'];
          for (var i = 0; i &lt; children.length; i++) {
              nodeId=children[i]['nodeId'];
              console.log(nodeId);
              $('.node-tree[data-nodeid="'+nodeId+'"]').click();
          }
  });
  </code></pre>