Avendo difficoltà a eseguire il debug di questo.jQuery UI Droppable Uncaught TypeError
Utilizzo dell'interfaccia utente jQuery Droppable in un'applicazione Backbone mediante CoffeeScript.
Non c'è niente di sbagliato nella funzionalità, tutto sta funzionando come lo intendevo, ma sto ancora ricevendo questo errore della console ogni volta che un oggetto viene rilasciato.
Uncaught TypeError: Cannot read property 'options' of undefined
Codice in materia di droppable:
@$el.droppable
tolerance: 'pointer'
hoverClass: 'drop_hover'
accept: '.item'
drop: (e, ui) =>
draggedItem = ui.draggable
itemId = draggedItem.attr 'data-id'
allInstances = @model.collection.models
findItems = for instance in allInstances
instanceItems = instance.get 'items'
instanceItems.getByCid itemId
compacted = _.compact findItems
droppedItem = compacted[0]
droppedCollection = droppedItem.collection
droppedCollection.remove droppedItem if _.include droppedCollection.models, droppedItem
@itemCollection.add droppedItem unless _.include @items, droppedItem
Come ho già detto la funzionalità funziona correttamente, ho appena vorrebbe sbarazzarsi della errore se qualcuno sa qualcosa potrei provare a eseguire il debug.
Stack Trace
Uncaught TypeError: Cannot read property 'options' of undefined
a.ui.plugin.add.stopjquery-ui.js:49
a.ui.version.a.extend.plugin.call jquery-ui.js:9
a.widget._trigger jquery-ui.js:49
a.widget._mouseStop jquery-ui.js:49
a.widget._mouseUp jquery-ui.js:28
a.widget._mouseUp jquery-ui.js:49
a.widget._mouseDown._mouseUpDelegate jquery-ui.js:28
f.event.dispatch jquery-1.7.1.min.js:3
f.event.add.h.handle.i jquery-1.7.1.min.js:3
Grazie per qualsiasi aiuto.
è la traccia dello stack dell'errore che ti dà qualche suggerimento? – dira
Niente di utile per me. L'ho aggiunto alla domanda. – mgaughan
Sembra quindi un problema di jQuery. Date un'occhiata a questo http://forum.jquery.com/topic/on-draggable-destroy-uncaught-typeerror-cannot-read-property-options-of-undefined – dira