Finds sidebar node with id and returns it or its index.
get([parent], [id], [returnIndex])

parent | string, id of the parent node (optional)
id | string, id of the sidebar node (optional)
returnIndex | boolean, if true returns index in the nodes array (optional)

Returns object or integer or null.

#### Description

The id argument is the id of the sidebar node used during its creation. Nodes can be nested. Each node has .nodes array that holds its children. If sidebar node was not found the method will return null.
You can optionally specify parent, which is an id of the parent node. If parent is specified then it will limit the search scope to that parent and its subnodes.
The third optional argument returnIndex indicates if you want the sidebar node or its index in the .nodes array.
You can call this method without any arguments and it will return to you ids of all nodes in the entire sidebar.
If you defined the object in the following way: $('#sidebar').w2sidebar({ name : 'sidebar', img : 'icon-page', nodes: [ { id: 'id-1', text: 'Level 1' }, { id: 'id-2', text: 'Level 2' }, { id: 'id-3', text: 'Level 3' } ] }); To get ids of all nodes: var all = w2ui['sidebar'].get(); console.log(all); To get a specific node: var node = w2ui['sidebar'].get('id-2'); console.log(node);