I have a drag n drop function that takes the position in my db and that puts it in the good order on the screen I can move my boxes around that's all ok but when i move a boxes it's supposed to send it to my db and the line where it doesn't work is
$.post('updatePanels.php', 'data='+
$.toJSON(sortorder), function(response){
I'Ve put the section in blue at the bottom of the script
function updateWidgetData(){
var items=[];
$('.column').each(function(){
var columnId=$(this).attr('id');
$('.dragbox', this).each(function(i){
var collapsed=0;
if($(this).find('.dragbox-content').css('display')=="none")
collapsed=1;
//Create Item object for current panel
var item={
id: $(this).attr('id'),
collapsed: collapsed,
order : i,
column: columnId
};
//Push item object into items array
items.push(item);
});
});
//Assign items array to sortorder JSON variable
var sortorder={ items: items };
//Pass sortorder variable to server using ajax to save state
$.post('updatePanels.php', 'data='+$.toJSON(sortorder), function(response){
if(response=="success")
$("#console").html('<div class="success">Saved</div>').hide().fadeIn(1000);
setTimeout(function(){
$('#console').fadeOut(1000);
}, 2000);
});
}
</script>
If somebody could help that would be very usefull
Thank you