I have a table in which I am using Jquery UI sortable.

I am using a place holder which is a clone of the item being moved.

 $("#sortable tbody").sortable({
     items: 'tr[id!=noSort]', start: function (event, ui) {
                clone = $(ui.item[0].outerHTML).clone();
             },
             placeholder: {
                 element: function (clone, ui) {
                     return $('<tr class="OddTableRow move"">' + clone[0].innerHTML + '</tr>');
                 },
                 update: function () {
                     return;
                 }
             }
        });

This is working great, however, I just want to see the place holder moving up and down the table and not the table row moving with my mouse all over the screen. Has anyone ever tried to do this? Any pointers?

有帮助吗?

解决方案

Just use the cursor option along with the rest of your code, and set it to none

would build you a fiddle but you didn't provide html

 $("#sortable tbody").sortable({
     cursor: "none",
     items: 'tr[id!=noSort]', start: function (event, ui) {
                clone = $(ui.item[0].outerHTML).clone();
             },
     placeholder: {
                 element: function (clone, ui) {
                     return $('<tr class="OddTableRow move"">' + clone[0].innerHTML + '</tr>');
                 },
                 update: function () {
                     return;
                 }
     }

  });
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top