複数のjqueryソート可能リストを含むページがあります。これらの各リストにはsp_idがありますが、これをスクリプトに渡すにはどうすればよいですか?
<script type="text/javascript">
$(function() {
$(".sortable").sortable({ opacity: 0.6, cursor: 'move', update: function() {
var order = $(this).sortable("serialize", "placeholder") + '&action=updateRecordsListings&sp_id=' + ???;
$.post("updatedb.php", order, function(order) {
alert(order);
});
}
});
});
ソート可能な各ulにある種のsp_idフィールドを配置する必要があると思います
<ul class="sortable"
-- ?? Some field with the sp_id ?? --
<li class="ui-state-default">Item 1</li>
<li class="ui-state-default">Item 2</li>
</ul>