Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Looking at the source for ui.sortable.js (1.7.2), you can cheat and set the <code>placeholder</code> to an object with a <code>element</code> function and an <code>update</code> function. The <code>element</code> function is used to return the placeholder dom object and the <code>update</code> function allows you to do things like correct its size (you can check out the <code>_createPlaceholder</code> function inside sortable if you want to see what the default implementation does).</p> <p>So for example, the following will create a list item with the word <em>test</em> inside as your placeholder (note that it returns the actual dom object (<code>[0]</code>) and not the jQuery object itself):</p> <pre><code>$("#sortable").sortable({ placeholder: { element: function(currentItem) { return $("&lt;li&gt;&lt;em&gt;test&lt;/em&gt;&lt;/li&gt;")[0]; }, update: function(container, p) { return; } } }); </code></pre> <p>If I'm reading source correctly, the <code>element</code> function should be passed the current item (jQuery object) and <code>this</code> should point to the <code>sortable</code> itself (i.e. <code>$("#sortable")</code> in this instance). In <code>update</code> you're passed the "container" which is the object which holds all the options, &amp; the element, etc &amp; the <code>placeholder</code> itself.</p> <p><strong>Please note that this is an undocumented hack</strong>, so it would obviously be unsupported &amp; may change with the next version of jQuery UI... but it still may be of use to you, given you were talking about editing <code>ui.sortable.js</code> directly anyway.</p> <p>Hope that helps.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload