Revision history [back]

click to hide/show revision 1
initial version

answered 2015-02-06 10:17:43 +0800

cyiannoulis gravatar image cyiannoulis

Well, here is a workaround to listen the onDrop event using a little javascript:

<zk>
<textbox id="searchBox" />

<script type="text/javascript">
   zk.afterMount(function() {
    $('$searchBox').bind('drop', function (e) {
       var searchValue = e.originalEvent.dataTransfer.getData('Text');
       alert(searchValue);
    });
   });
</script>
</zk>

As you see, the dropped text is stored into a javascript variable which then you can send it back to the server to do whatever you want.

Costas

Well, here is a workaround to listen the onDrop event using a little javascript:javascript. The difference with the previous sample is that you may drag n drop any text from any web page:

<zk>
<textbox id="searchBox" />

<script type="text/javascript">
   zk.afterMount(function() {
    $('$searchBox').bind('drop', function (e) {
       var searchValue = e.originalEvent.dataTransfer.getData('Text');
       alert(searchValue);
    });
   });
</script>
</zk>

As you see, the dropped text is stored into a javascript variable which then you can send it back to the server to do whatever you want.

Costas

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More