I have a working sortable portlet running with php and mysql. My problem is i cant get the delete function working with just the icon inside the portlet-header.instead the deleting covers to complete portlet class (what makes sence) however i need it only for the ui-icon-closethick
$(function() {
$(".portlet").click(function() {
var commentContainer = $(this).addClass("ui-icon-closethick");$(this).parent();
var id = $(this).attr("id");
var string = 'id='+ id ;
$.ajax({
type: "POST",
url: "server_items_reorder.php",
data: string,
cache: false,
success: function(){
commentContainer.slideUp('slow', function() {$(this).remove();});
}
});
return false;
});
});
$(function() {
$(".column").sortable({
connectWith: '.column',
update: savelayout
});
$(".portlet").addClass("ui-widget ui-widget-content ui-helper-clearfix ui-corner-all")
.find(".portlet-header")
.addClass("ui-widget-header ui-corner-all")
.prepend('')
.prepend('')
.end()
.find(".portlet-content").toggle();
$(".portlet-header .ui-icon-minusthick").toggle(function() {
$(this).removeClass("ui-icon-minusthick");
$(this).addClass("ui-icon-plusthick");
$(this).parents(".portlet:first").find(".portlet-content").toggle();
}, function() {
$(this).removeClass("ui-icon-plusthick");
$(this).addClass("ui-icon-minusthick");
$(this).parents(".portlet:first").find(".portlet-content").toggle();
}
);
$(".column").disableSelection();
});