Adds a sidebar node or nodes.
add([parent], nodes)

parent | string, id of the parent node (optional)
nodes | object or array, sidebar nodes to add

Returns object.

#### Description

The nodes argument can be either an object or array of objects. If it is an object it represents a sidebar node that will be added to .nodes array. If it is an array then each element of the array will be treated as a separate sidebar node object.
The first optional argument parent is an id of the parent node or parent node itself. If parent node is not specified, new nodes will be inserted at the root level.
The method will return last inserted node.
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' } ] }); You can: w2ui['sidebar'].add('id-1', { id: 'id-1-1', text: 'Level 1-1' }); // or w2ui['sidebar'].add('id-2', [ { id: 'id-2-1', text: 'Level 2-1' }, { id: 'id-2-2', text: 'Level 2-2' }, { id: 'id-2-3', text: 'Level 2-3' } ]);