jquery sortable accordion should stay closed on drop -
jquery sortable accordion should stay closed on drop -
i have sortable accordion. when drop accordion opens dropped section default. not want open dropped section rather should remain closed when drop section. here code
$( "#accordion" ).accordion({ header: "> div > h3", heightstyle: "content", collapsible: true, active: false, activate: function( event, ui){ //this fixes problems sorting if panel open (remove see talking about) if(sorting) $(this).sortable("refresh"); } }) .sortable({ handle: "h3", value: "ui-state-highlight", start: function( event, ui ){ //change bool true sorting=true; //find tab open, false if none active = $(this).accordion( "option", "active" ); //possibly alter animation here $(this).accordion( "option", "animate", { easing: 'swing', duration: 0 } ); //close tab $(this).accordion({ active:false }); unloadeditors(); }, stop: function( event, ui ) { $(this).accordion( active, false); loadeditors(); sorting=false; }, update: function(event, ui) { var params = $(this).sortable('toarray'); //alert(params); var pageurl = $("#orderurl").val(); datastring = 'ordering='+params; $.ajax({ type: "post", url: pageurl, data: datastring, success: function(data) { //data = jquery.trim(data); } }); } });
thanks in advance,
aisha
i have fixed issue triggering click event in stop handler. here code
$( "#accordion" ).accordion({ header: "> div > h3", heightstyle: "content", collapsible: true, active: false, activate: function( event, ui){ //this fixes problems sorting if panel open (remove see talking about) if(sorting) $(this).sortable("refresh"); } }) .sortable({ handle: "h3", value: "ui-state-highlight", start: function( event, ui ){ //change bool true sorting=true; //find tab open, false if none active = $(this).accordion( "option", "active" ); //possibly alter animation here $(this).accordion( "option", "animate", { easing: 'swing', duration: 0 } ); //close tab $(this).accordion({ active:false }); unloadeditors(); }, stop: function( event, ui ) { ui.item.children( "h3" ).triggerhandler( "click" ); sorting=false; }, update: function(event, ui) { var params = $(this).sortable('toarray'); //alert(params); loadeditors(); var pageurl = $("#orderurl").val(); datastring = 'ordering='+params; $.ajax({ type: "post", url: pageurl, data: datastring, success: function(data) { //data = jquery.trim(data); } }); } });
jquery
Comments
Post a Comment