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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:57:54+00:00 2026-05-23T10:57:54+00:00

I have Tree, loaded from XML exactly like this . Additionally I enable drag

  • 0

I have Tree, loaded from XML exactly like this.

Additionally I enable drag and drop.
Now after making changes in tree by drag and drop, we should be able to get new data so that I can generate new xml.

Even JSON would help to re-generate new xml.

  • 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-23T10:57:55+00:00Added an answer on May 23, 2026 at 10:57 am
    function getJson(treeNode) {
        treeNode.expandChildNodes();
        var json = {};
        var attributes = treeNode.attributes;
        for(var item in attributes){
            if (item == 'src' || item == 'text') {   //only use required attributes
                json[item] = attributes[item];
            }
        }
        json.children = [];
        if(treeNode.childNodes.length > 0){
            for (var i=0; i < treeNode.childNodes.length; i++) {
                json.children.push(getJson(treeNode.childNodes[i]));
            }
        }
        return json;
    }
    
    // To use above function:
    var comp = Ext.getCmp('tree-panel'); //id of the tree panel
    var myJSON = getJson(comp.getRootNode());
    console.log(Ext.encode(myJSON.children));
    

    Can’t think about creating XML. I’ll make it on server side..

    Hope someone could also work on it.

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

Sidebar

Related Questions

I have a tree in flex built from an XML document into an XMLlist
I have an XML Sitemap like this <?xml version=1.0 encoding=utf-8 ?> <Menu> <MenuItem Name=Page
I have a tree structure in memory that I would like to render in
I have a tree of active record objects, something like: class Part < ActiveRecord::Base
I have the next two facts loaded in my prolog interpreter: foo(U+V,1). foo(U*V,2). Now
I have a treeList, loaded with data from SQL DB. The logigs in sql
I've been away from web design/development for a long, long now and have recently
I have tree control object created using CTreeCtrl MFC class. The tree control needs
I have tree tables, Customer, Invoice and InvoiceRow with the standard relations. These I
I have a tree representation of pages in a CMS application. I understand how

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.