jQWidgets Forums

jQuery UI Widgets Forums Navigation Tree getting the child nodes

Tagged: ,

This topic contains 4 replies, has 2 voices, and was last updated by  Peter Stoev 12 years, 2 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • getting the child nodes #15914

    ryan paul
    Participant
    how can i get the selected last child if 
    for example i have a tree generated from json and the checkbox property is enabled
    which is something like this:
    -Chocolate Beverage
    -Hot Chocolate (*)
    -Peppermint Hot Chocolate (*)
    -Salted Caramel Hot Chocolate
    -White Hot Chocolate
    -Espresso Beverage (*)
    -Caffe Americano (*)
    -Caffe Latte (*)
    -Frappuccino
    -Caffe Vanilla Frappuccino
    -450 calories (*)
    -16g fat (*)
    -13g protein
    -Caffe Vanilla Frappuccino Light
    -Others (*)
    those with asterisk are checked so my goal is to acquire the
    - Hot Chocolate
    - Peppermint Hot Chocolate
    - Caffe Americano
    - Caffe Latte
    - 450 calories
    - 16g fat
    - Others
    as you have noticed, the "Espresso Beverage" is omitted because it has a child
    and i only want to get the child nodes
    getting the child nodes #15918

    Peter Stoev
    Keymaster

    Hi ryan paul,

    To get the checked tree items, you can use the jqxTree’s “getCheckedItems” method.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    getting the child nodes #15986

    ryan paul
    Participant

    do you have an example of doing so?

    getting the child nodes #15987

    ryan paul
    Participant

    i mean how can i get the array of the selected data,

    data = [];
    var item = $(‘#jqxTree’).jqxTree(‘getCheckedItems’);
    data = item.label;

    does this example will match so that i can get this value

    var data = [ “Peppermint Hot Chocolate”, “Caffe Americano”, “Caffe Latte”, “450 calories”, “16g fat”, “Others”];

    getting the child nodes #16008

    Peter Stoev
    Keymaster

    Hi ryan paul,

    “getCheckedItems” will return all tree items with checked state = “true”. Each tree item has “label” field returning the item’s text. The item’s “value” field returns the item’s value.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.