I wanted to know if there is a way to cancel the default operation in dojo. I am doing some user manipulation in a function,
dojo.subscribe("/dnd/drop/before", function(source, nodes, iscopy){ //Custom manipulation });
And from this function, I want to cancel the drop, similar to what happens when you press the Esc key?
thank
You can post a topic dnd/cancel, i.e. dojo.publish('/dnd/cancel'), then call dojo.dnd.manager().stopDrag()to cancel the deletion.
dnd/cancel
dojo.publish('/dnd/cancel')
dojo.dnd.manager().stopDrag()
But the recommended way is to configure checkAcceptance()of dojo.dnd.Sourceto return falsewhen the current node is not disconnected. See dojo dnd doc for details .
checkAcceptance()
dojo.dnd.Source
false
onDrop . Accourding to doc, - :
onDrop
var source2 = new dojo.dnd.Source("source", { onDrop : function(source, nodes, copy) { if (canProceedCondition) { this.onDropExternal(source, nodes, copy); } } });
Source: https://habr.com/ru/post/1754659/More articles:Is it necessary to develop applications for SPARC, IBM power CPU for individual compilers, other than x86, x86-64 goals? - compiler-constructionhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1754655/how-can-i-keep-a-file-in-another-git-repository-up-to-date-in-my-repository&usg=ALkJrhjuTwdMqI6TUpY3TV99xCJevxtPgwsending data between server and client in twisted - twistedTemplate / methodology for interaction between Windows and / or UserControls - c #Perl executing linux shell commands that are multi-line require authentication? - command-lineHow to get java exe code? - javaClass: ADORecordSet_mysql An easy way to get an array with the row id index - phphttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1754662/java-getdesktop-open-command&usg=ALkJrhhmj0pe55j949W7bZpGG5YGcbA8jQcreate sk_buff for linux output kernel kernel - linuxnotification when a program is in the background iOS 4 - iphoneAll Articles