1

How to prevent or stop dragging empty td cells, I'm using jQuery UI's Draggable.

My code:

$("#demo table tr td").draggable({
         helper: 'clone',
         revert: 'invalid',
         cursor: "move",
         start: function (event, ui) {
             setValues($(this).attr('id'),$(this).val());

         },

         stop: function (event, ui) {
            $(this).css('opacity', '1');

         }
     });

1 Answer 1

1

Try this:

$("#demo table tr td:not(:empty)").draggable({
         helper: 'clone',
         revert: 'invalid',
         cursor: "move",
         start: function (event, ui) {
             setValues($(this).attr('id'),$(this).val());

         },

         stop: function (event, ui) {
            $(this).css('opacity', '1');

         }
     });

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.