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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T03:00:53+00:00 2026-06-02T03:00:53+00:00

I’m using Dojo toolkit to get data from an external JSON source (a web

  • 0

I’m using Dojo toolkit to get data from an external JSON source (a web service) via ajax request. I’m using this retrieved data to create an ItemFileReadStore, and then I use its fetch method to print some attributes of the objects that it contains.

JSON source has nested attributes, an example here:

[    
 {
  "name":"michael",
  "surname":"owen",
  "reference": [
    {
      "code":21,
      "date":"01-01-2001"
    },
    {
      "code":134,
      "date":"11-05-2011"
    }
  ]
 },
 {
  "name":"robert",
  "surname":"foreman",
  "reference": [
    {
      "code":33,
      "date":"11-10-2009"
    }
  ]
 },
]

As you can see, “reference” is an array of objects with two attributes each one.

The problem: I create an ItemFileReadStore with this data and when I try to fetch it doesn’t shows anything. I’ve been testing this and I confirm that it works with plain estructures (without nested objects).

I think probably the store is not well-created.

Code of the fetch:

var store = ItemFileReadStore({data: response});  
store.fetch( { query: {'name': 'michael'}, onItem: function(item) {
                            console.log(store.getValue( item, 'surname' ));
                        }
                    });

So, the question is: Could I read nested structures somehow? maybe with another kind of store? Using another syntax?

Thanks!

  • 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-02T03:00:54+00:00Added an answer on June 2, 2026 at 3:00 am

    The answer depends on how you want to use the store.

    The new dojo.store API allows you to pass a function as the query and you can do the custom filtering in the function.

    http://dojotoolkit.org/features/1.6/object-store

    However, many of the current dojo widgets still use the dojo.data API (ItemFileReadStore). There is an adapter, but you cannot pass a function into the query.

    Some widgets like the grid, allow you to set the items directly and not have to query. If that is the case, you can use the new store API to query and manually set the items onto the grid.

    There’s also dojox.json.query, but I have never used it.

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
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 am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains

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.