Hi Everybody,
I try to use the nice plugin NestedSortables but I meet a probleme...
when I try to send the datas by a POST request, I can't retrieve all
datas which are serialized.
I use this code (HTML):
<ul id="list-container">
<li class="sortable" id="ele-1">
Element 1
</li>
<li class="sortable" id="ele-2">
Element 2
</li>
<li class="sortable" id="ele-3">
Element 3
<ul>
<li class="sortable" id="ele-4">
Element 4
<ul>
<li class="sortable" id="ele-5">
Element 5
</li>
</ul>
</li>
</ul>
</li>
</ul>
I use this Javascript code :
$(document).ready(function() {
jQuery( function($) {
$('#list-container').NestedSortable({
accept: 'sortable',
opacity: 0.6,
autoScroll: true,
helperclass: 'helper',
onChange: function(serialized) {
serial = serialized[0].hash;
$("#serialize").html(serial);
$.post("menu.php", 'menu= '+ serial);
}
});
});
});
In my menu.php, I meke a simple var_dump($_POST), here is the answer :
<pre>Array
(
[1] => Array
(
[id] => 1
)
[2] => Array
(
[id] => 3
[children] => Array
(
[0] => Array
(
[id] => 4
[children] => Array
(
[0] => Array
(
[id] => 5
)
)
)
)
)
)
</pre>
Where is the first item id ? I don't understand what's happening ...
Normaly I must retrieve this :
list-container[0][id]=2&list-container[1][id]=1&list-container[2][id]
=3&list-container[2][children][0][id]=4&list-container[2][children][0]
[children][0][id]=5
where is my fault ?
Thank's
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---