1. Item 1
    1. Sub Item 1.1
    2. Sub Item 1.2
  2. Item 2
    1. Sub Item 2.1
    2. Sub Item 2.2
    3. Sub Item 2.3
  3. Item 3 (no-nested)
  4. Item 4


Custom methods:

serialize
Serializes the nested list into a string like setName[itemId]=parentId&setName[itemId]=parentId from each item's id reading 'setName_itemId' (where itemId is a number).
It accepts the same options as the UI Sortable method.
toArray
Builds an array where each element is in the form:

setName[n] =>
{
	'item_id': itemId,
	'parent_id': parentId,
	'depth': depth,
	'left': left,
	'right': right,
}
looking at the items' id's as in serialize.
The left and right values comply with the nested set model.
This method accepts two options:
startDepthCount sets the starting depth number (default is 0), expression is the regex used to extract the number from the item's id (default is the same as serialize).
The first array element is the root element which contains all the others, and it is built from the available data with no need for any special entry.