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 7773051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:01:53+00:00 2026-06-01T17:01:53+00:00

In a tree built with jsTree, I have the text within the <a> tag

  • 0

In a tree built with jsTree, I have the text within the <a> tag sitting in a variable. I would like to check that node. How can I do so?

I am currently finding that node, using jQuery, and altering its class. However, this does not repair the parent node by making the parent undetermined in its class. I tried doing $('.colors').jstree("checkbox_repair"), but that didn’t seem to do anything.

It would be great if someone could actually answer both those questions, since they are related to the same problem.

Here is a jsFiddle, illustrating the issue–> http://jsfiddle.net/thapar/5XAjU/

  • 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-01T17:01:55+00:00Added an answer on June 1, 2026 at 5:01 pm

    In js_tree there are .check_node ( node ) and .uncheck_node ( node ) functions, i think this is what you are asking for. Soe the documentation here: http://www.jstree.com/documentation/checkbox

    This is an excerpt from the documentation in the link above, “how to perform an operation”:

    /* METHOD ONE */
    jQuery("some-selector-to-container-node-here")
        .jstree("operation_name" [, argument_1, argument_2, ...]);
    
    /* METHOD TWO */
    jQuery.jstree._reference(needle)
        /* NEEDLE can be a DOM node or selector for the container or a node within the container */
        .operation_name([ argument_1, argument_2, ...]);
    

    So I think this syntax should work

    $.jstree._reference(".colors").check_node('li#tree_3');
    

    Also i am not sure you should be using a class to reference your tree. Probably use an ID to reference your tree, and then use this syntax:

    $.jstree._reference("#colors").check_node('li#tree_3');
    

    //EDIT: Please keep in mind that the newest version of jsTree doesn’t have a function called _reference anymore. It got renamed to reference (without the leading underscore). (Last checked 24/08/2015 15:45 by @mkli90)
    Link: https://www.jstree.com/api/#/?f=$.jstree.reference(needle)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have built a little repeater HtmlHelper for asp.net MVC and I would like
I have 2 web applications built from the same source tree within tomcat, which
I have a node tree built out of Node objects. They are more complex
I have a deep tree structure built with lists, containing lists and floats. I
I have a tree in flex built from an XML document into an XMLlist
I have a basic Tree built in Flex. The Tree works fine. I'm attempting
I have a web application with a category tree that is published on the
I rendered a check box node tree. The renderer renders the parent nodes with
I have a Categories table, built with Tree architecture, using Doctrine Tree Extension and
I am using jsTree to display a tree structure of hierarchical data within my

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.