Saturday, March 29, 2014

Cannot call method 'removeChild' of null on beforeStop for sortable in jquery by Sachin Gevariya

I am using jQuery sortable for drag and drop an item from one place to another place and I am using start and stop for event start and stop.

But I am using beforeStop for avoid some movements of item from one place to anther place but its show me an error like that: Cannot call method 'removeChild' of null

Here I am using this one:
   beforeStop: function(event, ui){ 
            var firstNameClass = ui.item.firstChild.className;
           
            if (firstNameClass == "firstName"){
                $(this).sortable('cancel');
            }
        }

For resolve this error remove this code from beforeStop() to Stop() and that's working for me!!!!!


0 comments:

Post a Comment