Actually,my problem is not solved completely...The thing is that i made a tree in mvc and for having expanded and collapsed tree ,i added this java script code which you can see below. at first i add a 'handle' class to each
in the image u can see that 'fff' and 'ggg' must be in a same level because they are both children of 'eee' . 'ccc' seems to be the child of 'bbb' but it also must be in the same level as 'bbb'.Because both 'bbb' and 'ccc' are children of 'aaa'....
i dont know why java script code does not work.
$(document).ready(function () { jQuery("#tree ul").hide();
   jQuery("#tree li").prepend("<span class='handle'></span>");
    jQuery("#tree li:has(ul)")
      .children(":first-child").addClass("collapsed")
      .click(function () {
          jQuery(this).toggleClass("collapsed expanded")
            .siblings("ul").toggle();
      });
});
$(function () {
    $("ul#tree li").each(function () {
        as = $(this).children('a');
        if (!as.length) {  //
            $(this).hide();
        }
    })
});
 
     
     
    