Remove item from sortable, on receive event.
I have a draggable list connected to a sortable, and I want to limit the number of items the sortable can receive.
So in the receive event of my sortable I'm doing something like this:
- receive: function(event, ui) {
- if(num_of_items >= threshold)
- {
- ui.item.remove();
- }
- }
This give me the error:
Uncaught TypeError: Cannot read property 'options' of undefined
I can remove items on other events this way, but I really need to do it on the receive event. Any thoughts?