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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:34:13+00:00 2026-05-24T03:34:13+00:00

So I have a jstree that looks like this: Root -1 -2 –2.1 —2.1.1

  • 0

So I have a jstree that looks like this:

Root
-1
-2
–2.1
—2.1.1
—-2.1.1.1 through 2.1.1.24 (as in 24 children under 2.1.1)
—2.1.2
—-2.1.2.1 through 2.1.2.24 (as in 24 children under 2.1.1)
–2.2
-3

When I generate the json in order to stringify and send to the server (post user mucking around with it), before it gets sent to the server I can see that the post stringify json has duplicated a bunch of data. For instance, 2.1.1.1-24 gets duplicated twice under 2.1.1, and 2.1.1 (along with the double-duplication of 2.1.1.1-24) gets duplicated later in the string. The same goes for some other elements. 2.1.2 gets duplicated, but the data under it 2.1.2.1-24 doesn’t get duped twice.

As in this is what I see in the string:
…
—2.1.1
—-2.1.1.1 through 2.1.1.24 (as in 24 children under 2.1.1)
—-2.1.1.1 through 2.1.1.24 (as in 24 children under 2.1.1)
(NOTE: twice for the 1-24 children)

Then that whole block above gets repeated again later in the string.

The 2.1.2 block likewise gets repeated twice. Of course once it gets to the server and I deserialize the string into objects its a real mess. Any ideas?

var v = jQuery.jstree._reference("#tree").get_json(-1);
var mytext = JSON.stringify(v);
alert(mytext);

I can see in the pop up all the duplicated data. It appears to be duplicating children under the higher level parent. Once I deserialize, I see that some of the instances of that duplicated data appears as a child of “Root” even though said data is grand-child/great grandchild. Under root, the only “children” should be 1, 2, & 3. Instead, I have 1, 2, 2.1, 2.1.1 (along with 2.1.1.1-24) 2.1.2 (but oddly not 2.1.2.1-24), 2.2 & 3.

PS – I’ve tested this in the latest versions of IE, Firefox, and Chrome.

  • 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-24T03:34:14+00:00Added an answer on May 24, 2026 at 3:34 am

    Discovered the problem. My tree is being auto-generated from a database. I had left out part of the composite name I’m using for the “id” of the elements. Because of this “id” was not unique throughout the document. E.g. “Root” and 2.1.1 had the same “id” value, and that was why various elements got duplicated.

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

Sidebar

Related Questions

I have a JsTree that gets populated based on the JSON Data that I
I have a jsTree that I have rendered and is being generated by JSON
Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=
I have a Jstree that holds a lot of nodes, some of them have
I have a strange problem with JSTree and Ajax. I generate my tree via
I'm trying to set up jsTree to dynamically accept JSON data from django. This
I have two questions regarding jsTree: I am generating a jsTree using JSON with
I have a jQuery dialog and on top of that there is jstree. When
I am generating jstree from struts2 and JSON from database. From DB I have
I've just happened onto the jstree library. Looks like a great resource, but I've

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.