質問

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