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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T03:34:01+00:00 2026-06-11T03:34:01+00:00

I have a JSON like this. { children:[ {name: subdivision1,id: subdiv1,type: subdiv,children:[ {name: Scheme1,id:

  • 0

I have a JSON like this.

{
    "children":[
        {"name": "subdivision1","id": "subdiv1","type": "subdiv","children":[
            {"name": "Scheme1","id": "scheme1","type": "scheme","children":[
                {"name": "Nathuji","id": "nathuji","type": "datalogger","leaf":true},
                { "name": "Tarsang","id": "tarsang","type": "datalogger","leaf":true},
                { "name": "Mithapur","id": "mithapur","type": "datalogger","leaf":true},
                { "name": "Samali","id": "samali","type": "datalogger","leaf":true}]},
            {"name": "Scheme2","id": "scheme2","type": "scheme","children":[
                { "name": "Bhunidra","belongsto": "scheme2","id": "bhunidra","type": "datalogger","leaf":true},
                { "name": "Chhogala","belongsto": "scheme2","id": "chhogala","type": "datalogger","leaf":true}]
                }]},
        {"name": "subdivision2","id": "subdiv2","type": "subdiv","children":[
            {"name": "Scheme3","id": "scheme3","type": "scheme","children":[
                { "name": "Thana Savli","belongsto": "scheme3","id": "thanasavli","type": "datalogger","leaf":true},
                { "name": "Padardi","belongsto": "scheme3","id": "padardi","type": "datalogger","leaf":true}]
                }]}]}

Model like this.

Ext.define('DemoApp.model.dataloggerhierarchymodel',{
    extend: 'Ext.data.Model',
    fields: ['name','id','type'],
    proxy: {
        type: 'ajax',
        api: {
            read: 'data/allschemes.json'
        },
        reader: {
            type: 'json',
            root: 'children'
        }
    }
});

Store like this.

Ext.define('DemoApp.store.dataloggerhierarchystore',{
    extend: 'Ext.data.TreeStore',
    model: 'DemoApp.model.dataloggerhierarchymodel',
    autoLoad: true,
    listeners: {
        load:function(){
            console.log('Datalogger Tree store loaded');
        }
    },
    root: {
        expanded: true
    }
});

I am accessing it in the controller like,

var schemesStore = this.getDataloggerhierarchystoreStore();
        if(schemesStore == null || schemesStore == undefined){
            console.log('Store Undefined');
        }
        for(var i = 0; i< schemesStore.count();i++)
            {
                console.log('Record - '+schemesStore[i].get('id'));
            };

        schemesStore.each(function(currentRecord){
            console.log(currentRecord.get('id'));
        });

I am displaying it in a tree panel and it works fine. Now I want to access each record from the store.
But I am getting the error count() is not a function. The same in case of totalCount(), each(). What am I missing here? How can I access individual records from the store?

  • 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-11T03:34:03+00:00Added an answer on June 11, 2026 at 3:34 am

    Unfortunately, Ext.data.TreeStore is not a subclass of Ext.data.Store. It doesn’t have all of the methods that normal stores do. In order to access data, you have to access the root node by using getRootNode() and using the methods defined in Ext.data.NodeInterface.

    NodeInterface provides the cascadeBy() method as an equivalent of each(), and you’ll have to use it to code your own count() method.

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

Sidebar

Related Questions

I have a JSON like this { id:1, name:Jack, parent.id:2 } Note the dot
I have a REST service that returns a JSON like this: [{@id:123,name:Name}] and I'm
I have a json like this e.result = { 5474: { name: john, last:
I have some json code like this: { First name: David, Last name: Esseiva
Now i have a json code like this: {1: { text:e1, children: { 1:
I have some JSON data that looks like this: { data: [{ name:John Smith,
I have JSON like this: { something: http://something.com } and HTML like this: <a
i have json data like this {GetStudentDetails: {TotalCount:5, RootResults:[ {city:West Chester,country:USA,state:PA ,student_id:100}, {city:Philly,country:USA,state:PA,student_id:101}, {city:Buffalo,country:USA,state:NY,student_id:102},
I have a json string like this: { d: { results: [ { __metadata:
I have a JSON data like this: { hello: { first:firstvalue, second:secondvalue }, hello2:

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.