문제

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