jquery-ui-sortable

jQuery UI Sortable: Revert changes if update callback makes an AJAX call that fails?

£可爱£侵袭症+ 提交于 2020-05-09 19:30:24
问题 I am using the sortable widget to re-order a list of items. After an item is dragged to a new location, I kick off an AJAX form post to the server to save the new order. How can I undo the sort (e.g. return the drag item to its original position in the list) if I receive an error message from the server? Basically, I only want the re-order to "stick" if the server confirms that the changes were saved. 回答1: I'm pretty sure that sortable doesn't have any undo-last-drop function -- but it's a

jquery-ui sortable - programmatically set item being dragged

强颜欢笑 提交于 2020-02-08 07:52:07
问题 I have a list of items I want to make sortable. I would like to make that list scrollable, but at the same time I want the handle to pop out to the side of the list. When clicking on an list item, I can have the pop out show outside the list (at this point, I know which li they have selected), and when they mousedown on a button in the popout, I create the sortable. Can I create the sortable with the current li as the item being dragged? The core issue here that I'm trying to work around is

jquery-ui sortable - programmatically set item being dragged

为君一笑 提交于 2020-02-08 07:52:05
问题 I have a list of items I want to make sortable. I would like to make that list scrollable, but at the same time I want the handle to pop out to the side of the list. When clicking on an list item, I can have the pop out show outside the list (at this point, I know which li they have selected), and when they mousedown on a button in the popout, I create the sortable. Can I create the sortable with the current li as the item being dragged? The core issue here that I'm trying to work around is

Droppable over event not firing on different tab

为君一笑 提交于 2020-02-06 06:16:23
问题 When I try to connect 2 lists which are seperated by tabs the over event is not firing on the list on the second tab. Here's my HTML <div id="TabSet" class="tabs"> <ul> <li class="tab"><a href="#tabs-1">Nunc tincidunt</a></li> <li class="tab"><a href="#tabs-2">Proin dolor</a></li> </ul> <div id="tabs-1"> <div style="padding: 10px;"> <ul class="list" id="list1"> <li class="ui-state-default">Item 1</li> <li class="ui-state-default">Item 2</li> </ul> <ul class="list" id="list2"> <li class="ui

Droppable over event not firing on different tab

ぐ巨炮叔叔 提交于 2020-02-06 06:16:09
问题 When I try to connect 2 lists which are seperated by tabs the over event is not firing on the list on the second tab. Here's my HTML <div id="TabSet" class="tabs"> <ul> <li class="tab"><a href="#tabs-1">Nunc tincidunt</a></li> <li class="tab"><a href="#tabs-2">Proin dolor</a></li> </ul> <div id="tabs-1"> <div style="padding: 10px;"> <ul class="list" id="list1"> <li class="ui-state-default">Item 1</li> <li class="ui-state-default">Item 2</li> </ul> <ul class="list" id="list2"> <li class="ui

Horizontal jquery sortable list, placeholder width is incorrect in IE11 when scroll is visible

淺唱寂寞╮ 提交于 2020-02-05 06:31:08
问题 I have a horizontal list which I am trying to sort using jqueryui sortable. As long as all items fits the window it works perfectly. But when I have many items, so that the scrollbar appear the placeholder width is to small. Or actually when I inspect the placeholder in IE developer tools the width is set to the correct value but it is still displayed as just a thin line. I have noticed that adding padding to the placeholder style can make it wider, but why can't I use the width? What I

jQuery UI sortable - drag element on click

ぃ、小莉子 提交于 2020-01-25 16:51:43
问题 I have two blocks, "draggable" and "sortable". Inside "draggable" I have few items which I can drag them to "sortable". I want to have the possibility to click an item inside "draggable" and automatically drag it into "sortable". Here is my JS: $(".sortableList").sortable({ placeholder: 'ui-state-highlight', }); $('.sortableList').disableSelection(); $(".draggable").draggable({ connectToSortable: '.sortableList', cursor: 'pointer', helper: 'clone', revert: 'invalid', start: function (event,

jQuery UI sortable - drag element on click

倖福魔咒の 提交于 2020-01-25 16:51:13
问题 I have two blocks, "draggable" and "sortable". Inside "draggable" I have few items which I can drag them to "sortable". I want to have the possibility to click an item inside "draggable" and automatically drag it into "sortable". Here is my JS: $(".sortableList").sortable({ placeholder: 'ui-state-highlight', }); $('.sortableList').disableSelection(); $(".draggable").draggable({ connectToSortable: '.sortableList', cursor: 'pointer', helper: 'clone', revert: 'invalid', start: function (event,

Sortable div with TinyMCE inline

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-25 08:06:22
问题 The code posted by vijayscode (https://stackoverflow.com/questions/34850038/tinymce-4-not-working-with-sortable-jquery-divs/59896435#59896435) doesn't work for me. TinyMCE doesn't work even before I start ordering. Does sorting work with TinyMCE in when using inline mode? For example, if I add the inline: true option to this code ... TinyMCE is not loaded immediately http://fiddle.tinymce.com/33faab Can you show me a working example on http://fiddle.tinymce.com/ 回答1: You are really asking two

Sortable div with TinyMCE inline

只愿长相守 提交于 2020-01-25 08:06:06
问题 The code posted by vijayscode (https://stackoverflow.com/questions/34850038/tinymce-4-not-working-with-sortable-jquery-divs/59896435#59896435) doesn't work for me. TinyMCE doesn't work even before I start ordering. Does sorting work with TinyMCE in when using inline mode? For example, if I add the inline: true option to this code ... TinyMCE is not loaded immediately http://fiddle.tinymce.com/33faab Can you show me a working example on http://fiddle.tinymce.com/ 回答1: You are really asking two