Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8001151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:00:53+00:00 2026-06-04T16:00:53+00:00

$(#ifTree).jstree({ plugins : [themes,html_data,ui,crrm], themes : { theme : apple, dots : true, icons

  • 0
$("#ifTree").jstree({
            "plugins" : ["themes","html_data","ui","crrm"], 
            "themes" : {
                    "theme" : "apple",
                    "dots" : true,
                    "icons" : false
            }           
    });

    $("#createIf_c").click(function () { 
        $("#ifTree").jstree("create",null,"inside",  { "data" :{ title:"if",value:"expression"} },
                function() {}, true);
    });
$("#display").click(function(){
            var a = $.jstree._focused().get_selected();
            alert(a.attr("value"));
    });

In this above code I have created a jstree and upon click of a button with id #createIf_c I am adding a node with title “if” but as I want some more data to be associated with this node , I have added more attributes to it while creating the node. Next when I am trying to access this associated data, here “value” then I am getting the alert ‘undefined’. So is there a different way for associating data with a node? or a different way of accessing the associated data of a node is jstree?..please help….

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T16:00:54+00:00Added an answer on June 4, 2026 at 4:00 pm

    The simplest way to do this is just like adding an attribute to an html element i.e.,

        var node = $.jstree._focused().get_selected(); //get the selected node or which ever you want the data to be associated with
        node.attr("expression","xyz"); //add an attribute (name,value) here, name-expression and value-xyz
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my program below, I set the variable th as true in the second
I'm trying to write a function to traverse a tree with depth first search.
This is my first ever attempt at writing a recursive function in c. The
is there a max function in c so i can do something like this
I am trying to insert items from my array into my tree. My function
Possible Duplicate: Where should I call Free() function? When I used valgrind --leak-check=full --show-reachable=yes
I want to remove the last new line from the following function: void WriteToFile(node
It seems that the inheritsFrom: method in GNU Smalltalk returns true for every undefined
I have a function to get the values of the selected check-box from the
I have declared a helper function to a method of a class I declared

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.