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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T21:42:02+00:00 2026-05-16T21:42:02+00:00

I’m working with jstree and I would like to know how to hide/show nodes

  • 0

I’m working with jstree and I would like to know how to hide/show nodes if possible. I gave the list items a “cat” id to select them with jquery but this doesn’t work.

Here’s the code.

html:

<div class="resultsContent">

    <div class="demo" id="demo_1">

    <ul>

    {% for ipc in ipcs %}

        {% ifequal ipc.back_list 1 %}   

            </ul></li>

        {% endifequal %}    

        {% ifequal ipc.kind "c" %}  

        <li id="{{ ipc.symbol }} cat" rel="node-type">
                {% else %}
                    <li id="{{ ipc.symbol }} cat" rel="node-type">
            {% endifequal %}
    {% endfor %}
    </ul>

</div>

</div>

script:

jQuery('#demo_1')

    .jstree({

        plugins : [ "themes", "html_data", "checkbox"  ], 

        themes : { theme: "default", dots : false, icons : false },         

        core : { "initially_open" : [ "{{ top_symbol }}" ] }, 

    })

$("#cat").slice(5, 10).hide(); //Hide some nodes 
  • 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-05-16T21:42:03+00:00Added an answer on May 16, 2026 at 9:42 pm

    It seems at your code that you are generating li elements with an ID composed by a IPC Symbol value plus a black space, plus the word “cat”.

    <li id="{{ ipc.symbol }} cat" rel="node-type">
    

    But, your selector is trying to get an element whose ID is exactly “cat”

    $("#cat").slice(5, 10).hide(); //Hide some nodes 
    

    Maybe you could use a different jQuery selector. By the example, Attribute Contains Selector:

    $("li[id*='cat']").slice(5, 10).hide(); //Hide nodes with the string 'cat'
    

    Or the Attribute Contains Word Selector, more appropriate in this case (because you are looking for a whole word):

    $("li[id~='cat']").slice(5, 10).hide(); //Hide nodes containing the word 'cat'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to count the length of a string with PHP. The string
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I would like to run a str_replace or preg_replace which looks for certain words
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I want to show the soap response to UIWebview.. my soap response is, <p><img

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.