The Problem:
I have a nested list on my configuration page that looks like this:
<a id='Save'>Save<a>
<ul id='configuration-list'>
<li id='e1'>Elem A
<ul>
<li id='ey'>Elem Y </li>
<li id='ex'>Elem X
<ul><!-- and so on until 5 levels of nesting --></ul>
</li>
<li id='ez'>Elem Z </li>
</ul>
</li>
<li id='e45'>
<ul>
<!-- more li's and ul's nesting here -->
</ul>
</li>
<!-- even more li's and ul's nesting here -->
<li id='eN'>
</li>
</ul>
Each li on the list can have another unordered list inside, which contains li, that can contain other unordered list inside.
All the list are sortable, using jquery ui.sortable plugin. Items cannot be switched through list.
The total of nodes in the list is more than 1k.
When the configuration is saved (Save link) I have to send the list order configuration (form the first to the deepest node) to the server which will parse it and save all the elements order in the database. For this, php is used.
The questions:
Whats the 'best' or the less wrong way to parse the configuration, and how should I pass it to my php parser?
Is there a method similar to $('#configuration-list').sortable('serialize')
or $('#configuration-list').sortable('toArray')
that generates me a xml, JSON or similar with all the structure? An extension of ui.sortable or another plugin that have this functionality?
Thanks in advance.