Ho un problema con jquery ui portlet.
Diciamo che funziona tutto e riesco a salvare su db mysql la posizione delle div, ma non so come caricare la loro posizione al caricamento della pagina, e quindi ad ogni refresh le portlet tornano nella loro posizione naturale ossia quella del codice html.
Suggerimenti?
intanto posto un po di codice
codice:$("#contenitore-centrale .column").sortable({ connectWith: [ '#contenitore-centrale .column' ], handle: '.portlet-header', opacity: 0.6, items: '> .portlet', tolerance: 'pointer', revert: true, distance: 2, helper: 'clone', update: function() { }, stop: function(event, ui) { var postVars = { action: 'portlet-order', } $("#contenitore-centrale .column").each(function(){ var $posizione = $(this).sortable('serialize'); var $column_id = $(this).attr('id'); postVars["order[" + this.id.split('-')[0] + "]"] = $(this).sortable( 'toArray' ).join(','); }); $.post("code/posizione.php", postVars , function(theResponse){ $("#results").html(theResponse); }); } }); $(".portlet").addClass("ui-widget ui-widget-content ui-helper-clearfix ui-corner-all") .find(".portlet-header") .addClass("ui-widget-header ui-corner-all") .prepend('<span class="ui-icon ui-icon-plusthick"></span>') .end() .find(".portlet-content"); $(".portlet-header .ui-icon").click(function() { $(this).toggleClass("ui-icon-minusthick"); $(this).parents(".portlet:first").find(".portlet-content").toggle(); }); $(".column").enableSelection();

Rispondi quotando