jQWidgets Forums

jQuery UI Widgets Forums Navigation Tree How to get all the elements of childnode in jqxtree?

Tagged: 

This topic contains 2 replies, has 1 voice, and was last updated by  Bikash Panigrahi 9 years, 2 months ago.

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

  • Bikash Panigrahi
    Participant

    Need to list all the child nodes of a node not tree in dragend event.


    Bikash Panigrahi
    Participant

    $(‘#jqxTree’).jqxTree({ ‘source’: records, height: ‘720px’, width: ‘350px’

    , allowDrag: true, allowDrop: true,
    dragStart: function (item) {

    },
    dragEnd: function (dragItem, dropItem, args, dropPosition, tree) {
    debugger;

    if (dropItem.level >= 2) {

    return false;

    }
    if (dropItem.level == 1) {
    if (dragItem.hasItems == true) {
    return false;
    }
    }

    if (dropItem.level == 0) {

    // If the child of a drop node has a child node then dragging should not happen
    }

    How will I do that?


    Bikash Panigrahi
    Participant

    Got the solution.

    var allItems = $(“#” + dragItem.id).children().length;

    for (var x = 0; x < allItems; x++) {
    if ($(“#” + dragItem.id).children()[x] == ‘[object HTMLUListElement]’) {
    var itemlist = $(“#” + dragItem.id).children()[x].childElementCount;
    for (var c = 0; c < itemlist; c++) {
    var citems = $(“#” + dragItem.id).children()[x].childNodes[c];

    if ($(“#” + citems.id).children().length > 1) {
    return false;
    }

    }
    }

    needed to loop through all elements(list).

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

You must be logged in to reply to this topic.