jQuery UI Widgets Forums Navigation Tree Dropping to an empty tree — cannot get dropped item.

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 9 years, 5 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author

  • kohowski

    Hi, below is a min working example of the issue I have.

    I need to drag items from one tree and drop to another. E.g. from a toolbox to the actual tree.

    I have this issue if only if the target tree is initially empty.

    After dropping to the target tree, I cannot get the corresponing tree item in the on ‘select’ handler, which is triggered on drop. Also, the item does not get the selected (highlighted, colored) state.

    There is no issue if the targed tree contains any single item at the beginning.

    Can someone please advise if I’m missing smth?

        <link rel="stylesheet" href="lib/jqwidgets/styles/jqx.base.css"
        <script type="text/javascript"
        <script type="text/javascript" src="lib/jqwidgets/jqxcore.js"></script>
        <script type="text/javascript" src="lib/jqwidgets/jqxdragdrop.js"></script>
        <script type="text/javascript" src="lib/jqwidgets/jqxbuttons.js"></script>
        <script type="text/javascript" src="lib/jqwidgets/jqxscrollbar.js"></script>
        <script type="text/javascript" src="lib/jqwidgets/jqxpanel.js"></script>
        <script type="text/javascript" src="lib/jqwidgets/jqxtree.js"></script>
    <div id='btnTree'>
            <li>Drag Me</li>
    <div id='jqxTree'>
            <!--<li>Single Item</li>--> <!-- try uncommenting this line, so the target tree has some nodes or does not -->
            <!-- more items can be here -->
    <script type="text/javascript">
            height: '300px',
            width: '300px',
            allowDrop: true
            height: '50px',
            width: '100px',
            allowDrag: true
        $('#jqxTree').on('select', function(event) {
            var args = event.args;
            var item = $('#jqxTree').jqxTree('getItem', args.element);
            console.log(item); // null
            item = $('#btnTree').jqxTree('getItem', args.element);
            console.log(item); // null

    Peter Stoev

    Hi kohowski,

    thank you for the feedback. we’ll look into that.

    Best Regards,
    Peter Stoev

    jQWidgets Team

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.