Я обращаюсь к виджетам jQuery. Мне нужно добавить кнопку Cross X
, которая удалит виджет. как мне это сделать?
Вот мой jsfiddle
Используйте метод destroy(), например,
$( ".selector" ).sortable( "destroy" );
В вашем коде
$(document).on('click','.close',function(){
$(this).closest('.column').sortable( "destroy" ).remove();// to destroy element
//$(this).closest('.column').sortable( "destroy" );// to destroy widget only
});
$('#column1').on('click', '.portlet-header .ui-icon',function() { $(this).sortable("destroy"); });
Не работает.