I'm looking at this source http://w2ui.com/web/demos/#!sidebar/sidebar-2
I'm able to add folders via:
$("#projectExplorer").w2sidebar({
name: "projectExplorer",
nodes: [
{ id: projectDir, text: projectName, img: "icon-folder", expanded: false, group1: true,
nodes: [
{ id: scriptsDir, text: "Scripts", img: "icon-folder", group1: true, expanded: false },
{ id: shaderDir, text: "Shaders", img: "icon-folder", group1: true, expanded: false }
]
}
]
});\
However, when I then try to dynamically add with the following:
w2ui.sidebar.insert(parent, null, [
{ id: currentFile, text: _files[i], img: "icon-page" }
]);
I get the error: TypeError: Cannot read property 'insert' of undefined
I have no ideas where w2ui.sidebar is coming from but it works in the example code above in the link so I figure it's some global variable the library is creating but clearly it's not there in my case which leads to the error, but no clue on what to do now.