The following code will display a list of ReportGroups but will not display the list items under each ReportGroup when it is selected.
type: "POST",
url: "wsReports.asmx/GetReports",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (list) {
var text = '';
text += "<ul id='newList' class='nav navbar-nav side-nav' data-toggle='dropdown'>";
$.each(list.d, function () {
text += "<li><a href='#'>" + this.ReportGroup + "</a>";
text += "<ul id='rptList' class='collapse'>"
$.each(this.Reports, function () {
text += "<li><a href='#'>" + this.ReportName + "</a></li>";
}); // end of each rptList
text += "</ul></li>";
}); // end of each newList
text += "</ul>";
$('#divSideBar').append(text);
}, //end of success
If I make the class = collapse.in in the rptList then I can see the list but the ReportGroups will not collapse.