I am implemented a jQuery UI sortable element.
Here is my code:
$(function() {
$( "#sortable" ).sortable({
placeholder: "ui-state-highlight",
stop: function(event, ui)
{
alert('pos:' + ui.position);
alert(ui.offset);
}
});
$( "#sortable" ).disableSelection();
});
The sorting is working. According to the documentation the the ui parameters in events will have several properties (e.g. ui.position, ui.offset, etc.)
When I alert these they are all returning [object Object]
I am trying to figure out what position was moved. (i.e. position 5 is now position 3) So I can save the new positions in a DB.
These parameters are objects, not strings.
alerting them callstoString(), which returns"[object Object]".You can see what is in the objects by
console.loging them instead.