I can't populate jsTree because something is wrong with the array that I'm creating.
jsTree allows you to pass in JSON data, so I'm trying to format an array of objects that jsTree will like:
var myAry = [];
$(xml).find('group').each(function() {
myAry.push({
"id": $(this).find('GroupID').text(),
"parent": "#",
"text": $(this).find('GroupName').text(),
});
});
When I dump [myAry] to the console, it looks like a properly formatted Array, but jsTree doesn't like it. However, if I create an array manually, jsTree likes it:
var testAry = [
{"id": "42", "parent": "#", "text": "Foo"},
{"id": "69", "parent": "#", "text": "Bar"},
{"id": "1", "parent": "#", "text": "Dolphin"},
];
What's going wrong in my loop?