This is a migrated thread and some comments may be shown as answers.

What am I doing wrong with drag and drop

1 Answer 63 Views
Drag and Drop
This is a migrated thread and some comments may be shown as answers.
Stan
Top achievements
Rank 1
Stan asked on 05 Feb 2013, 10:05 PM
I have been able to get it working, but only part of the time - as in some drags will register, but others will slide back to the original spot and not work. This is as stripped down as I can make it not work:

<div>
    <div id="drop" style="border: solid 1px green; ">
        bla<br />bla<br />bla<br />bla<br />bla<br />
    </div>
    <ul>
        <li id="t5" style="border:solid 1px red;">T5</li>
    </ul>
</div>
     
<script type="text/javascript">
    $(function () {
        $('#t5').kendoDraggable({
            hint: function (e) {
                return e.clone();
            }
        });
 
        $('div#drop').kendoDropTarget({
            drop: function (e) { console.log(e); }
        });
    });
</script>


With that, the drops will not register (nothing gets logged), but if I simply change 'div#drop' to 'body' (so it catches everything), the drop will log.  What am I not understanding?  I have nothing else on this test page other than a jquery 1.8.2 reference and kendo.  Thank you.

1 Answer, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 07 Feb 2013, 08:43 AM
Hello Stan,

The code you have posted seems ok - I tested it in the following jsbin (chrome, firefox, safari), and it seems to consistently log the object in question. I am not sure what goes wrong in your case. Is it possible for you to extend the example, along with more concrete instructions on how to reproduce it?

Thanks in advance,
Petyo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Drag and Drop
Asked by
Stan
Top achievements
Rank 1
Answers by
Petyo
Telerik team
Share this question
or