title: How to select sibling branch only of TreeView with jQuery?
body: <p>I have a multi-level treeview using KendoUI from Telerik and I'm trying to get the correct Id's for the branch of a re-ordered node.  </p>
  
  <pre><code>    &lt;ul id="root"&gt;
      &lt;li&gt;Item 1 (1)&lt;input type="hidden" name="PresetItemId" value="1" /&gt;
          &lt;ul&gt;
              &lt;li&gt;Item 1.1 (5)&lt;input type="hidden" name="PresetItemId" value="5" /&gt;&lt;/li&gt;
              &lt;li&gt;Item 1.2 (6)&lt;input type="hidden" name="PresetItemId" value="6" /&gt;
                  &lt;ul&gt;
                      &lt;li&gt;Item 1.2.1 (11)&lt;input type="hidden" name="PresetItemId" value="11" /&gt;&lt;/li&gt;
                      &lt;li&gt;Item 1.2.2 (12)&lt;input type="hidden" name="PresetItemId" value="12" /&gt;&lt;/li&gt;
                  &lt;/ul&gt;
              &lt;/li&gt;
          &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;Item 2 (2)&lt;input type="hidden" name="PresetItemId" value="2" /&gt;
          &lt;ul&gt;
              &lt;li&gt;Item 2.1 (7)&lt;input type="hidden" name="PresetItemId" value="7" /&gt;
                  &lt;ul&gt;
                      &lt;li&gt;Item 2.1.1 (13)&lt;input type="hidden" name="PresetItemId" value="13" /&gt;
                          &lt;ul&gt;
                              &lt;li&gt;Item 2.1.1.1 (18)&lt;input type="hidden" name="PresetItemId" value="18" /&gt;&lt;/li&gt;
                          &lt;/ul&gt;
                      &lt;/li&gt;
                      &lt;li&gt;Item 2.1.2 (14)&lt;input type="hidden" name="PresetItemId" value="14" /&gt;&lt;/li&gt;
                  &lt;/ul&gt;
              &lt;/li&gt;
              &lt;li&gt;Item 2.2 (8)&lt;input type="hidden" name="PresetItemId" value="8" /&gt;
                  &lt;ul&gt;
                      &lt;li&gt;Item 2.2.1 (15)&lt;input type="hidden" name="PresetItemId" value="15" /&gt;&lt;/li&gt;
                  &lt;/ul&gt;
              &lt;/li&gt;
              &lt;li&gt;Item 2.3 (27)&lt;input type="hidden" name="PresetItemId" value="27" /&gt;&lt;/li&gt;
          &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;Item 3 (3)&lt;input type="hidden" name="PresetItemId" value="3" /&gt;
          &lt;ul&gt;
              &lt;li&gt;Item 3.1 (9)&lt;input type="hidden" name="PresetItemId" value="9" /&gt;
                  &lt;ul&gt;
                      &lt;li&gt;Item 3.1.1 (16)&lt;input type="hidden" name="PresetItemId" value="16" /&gt;&lt;/li&gt;
                  &lt;/ul&gt;
              &lt;/li&gt;
              &lt;li&gt;Item 3.2 (10)&lt;input type="hidden" name="PresetItemId" value="10" /&gt;
                  &lt;ul&gt;
                      &lt;li&gt;Item.3.2.1 (23)&lt;input type="hidden" name="PresetItemId" value="23" /&gt;&lt;/li&gt;
                  &lt;/ul&gt;
              &lt;/li&gt;
              &lt;li&gt;Item 3.3 (19)&lt;input type="hidden" name="PresetItemId" value="19" /&gt;
                  &lt;ul&gt;
                      &lt;li&gt;Item.3.3.1 (24)&lt;input type="hidden" name="PresetItemId" value="24" /&gt;&lt;/li&gt;
                  &lt;/ul&gt;
              &lt;/li&gt;
              &lt;li&gt;Item 3.4 (20)&lt;input type="hidden" name="PresetItemId" value="20" /&gt;
                  &lt;ul&gt;
                      &lt;li&gt;Item.3.4.1 (25)&lt;input type="hidden" name="PresetItemId" value="25" /&gt;&lt;/li&gt;
                  &lt;/ul&gt;
              &lt;/li&gt;
              &lt;li&gt;Item 3.5 (21)&lt;input type="hidden" name="PresetItemId" value="21" /&gt;
                  &lt;ul&gt;
                      &lt;li&gt;Item.3.5.1 (28)&lt;input type="hidden" name="PresetItemId" value="28" /&gt;&lt;/li&gt;
                  &lt;/ul&gt;
              &lt;/li&gt;
              &lt;li&gt;Item 3.6 (22)&lt;input type="hidden" name="PresetItemId" value="22" /&gt;
                  &lt;ul&gt;
                      &lt;li&gt;Item.3.6.1 (26)&lt;input type="hidden" name="PresetItemId" value="26" /&gt;&lt;/li&gt;
                  &lt;/ul&gt;
              &lt;/li&gt;
          &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;Item 4 (4)&lt;input type="hidden" name="PresetItemId" value="4" /&gt;&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>My thought is that each parent contains children, and those children are independently sort-ordered from any other branch in the TreeView.</p>
  
  <p>So I need to grab all the siblings of the branch that the node is dropped onto and get the id's for only that branch level when the node is being sorted.  If any of those nodes have children, I do not want the children to be a part of the Id collection.</p>
  
  <p>I have it working, somewhat, but it's returning all the siblings (which is correct), but also all the children of those siblings (which is not correct).</p>
  
  <pre><code>var treeview;
  
  function onTreeViewDragEnd(e){
      var console = $("#console");
      //alert("source: " + treeview.text(e.sourceNode));
      //alert("destination: " + treeview.text(e.destinationNode));
  
      var list = $(e.destinationNode).siblings().not($(this).children());
  
      var data = $("input", list).serialize();
      console.html(JSON.stringify(data));
  }
  
  
  treeview = $("#root").kendoTreeView({
      dragAndDrop : true,
      dragend: onTreeViewDragEnd
  }).data("kendoTreeView");
  </code></pre>
  
  <p>I've started a jsfiddle on this: <a href="http://jsfiddle.net/kahanu/PdaRg/1/" rel="nofollow">http://jsfiddle.net/kahanu/PdaRg/1/</a></p>
  
  <p>To use this example, simply expand a node and then drop it somewhere else on the same branch and it will display the hidden input values for the branch (and the children, which is not what I want).</p>
  
  <p>Any help pointing me in the right direction is appreciated.</p>
  
  <p>Thanks.</p>