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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:58:54+00:00 2026-06-08T01:58:54+00:00

I am trying to build a dynamic tree. I am getting my data from

  • 0

I am trying to build a dynamic tree. I am getting my data from a C# WCF Service. It is returning me JSON data , but data is not reflecting in tree.
I am using EXTJS 4.

.Js Code –

Ext.require([
    'Ext.tree.*',
    'Ext.data.*',
    'Ext.tip.*'
 ]);    

Ext.onReady(function () {
    Ext.QuickTips.init();

var store = Ext.create('Ext.data.TreeStore', {
        proxy: {
                 type: 'ajax',
                 url: 'Services/InfographicsDataService.svc/GetTree'
               },
        root: {
                 text: 'Ext JS',
                 id: 'src',
                 expanded: true
              },
      reader: {
                 type: 'json',
                 root: 'd'
              }
    }); //  End of store code       

    var tree = Ext.create('Ext.tree.Panel', {
             store: store,
             viewConfig: 
             {
                plugins:{ ptype: 'treeviewdragdrop' }
             },
        renderTo: 'tree-div',
        height: 300,
        width: 250,
        title: 'Files',
        useArrows: true
    }); // End of tree    
}); // End of ready function   

This is the code at my service end-::

[OperationContract]
[WebGet]
 public List<TreeNode> GetTree()
 {
   List<TreeNode> nodes = new List<TreeNode>();
      nodes.Add(new TreeNode() { id="src/ModelManager.js", text = 
     "ModelManager.js" });

       nodes.Add(new TreeNode() { id="src/data", text = "data" });
      nodes.Add(new TreeNode() { id="src/draw", text = "draw" });
      return nodes;
 }

Json returned by wcf service–

{"d":[
  {
    "__type":"TreeNode:#Infographics.Services.Model",
    "id":"src\/ModelManager.js",
    "leaf":false,
    "text":"ModelManager.js"    
  },
 { 
   "__type":"TreeNode:#Infographics.Services.Model",
   "id":"src\/data",
   "leaf":false,
   "text":"data"
 },
 {
   "__type":"TreeNode:#Infographics.Services.Model",
   "id":"src   \/draw",
   "leaf":false,
   "text":"draw"
 }]
}

Call is going to server and returning the data but not adding nodes in tree
Page is showing just the root Extjs node.

Initially I thought , it is just root property of reader which I need to set to “d” , but there is something more I am missing.

Can somebody help me in finding what is that small mistake I am making ?

  • 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-08T01:58:55+00:00Added an answer on June 8, 2026 at 1:58 am

    Can you change the store like this and try,

    var store = Ext.create('Ext.data.TreeStore', 
    {
      proxy: 
      {
         type: 'ajax',
         url: 'Services/InfographicsDataService.svc/GetTree',
         reader: 
         {
            type: 'json',
            root: 'd'
         }
      },
      root:
      {
         text: 'Ext JS',
         id: 'src',
         expanded: true
      }  
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to build dynamic output from json and using jq/template tmpl display rows/columns. Somehow
I'm trying to build a dynamic table using PHP to insert data from a
I'm trying to build a multichoice AlertDialog using dynamic data. Ok, it's all loading
I was trying Build For Archiving application (from Titanium Mobile) with xCode 4.4, but
I am trying to build a real-time web service that deals with dynamic 10k
I'm trying to build a JAX-RS based web service using IBM RAD 7.5.5 (which
I'm trying to build a IE6 compatible site with dynamic images, but I can't
I am trying to build a dynamic web app using Eclipse Helios. I am
I am trying to build a cfquery using a dynamic column name: <cfquery dbtype=query
I'm trying to write a dynamic Linq 2 Sql query using Expressions trees but

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.