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

  • Home
  • SEARCH
  • 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 9183209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:44:48+00:00 2026-06-17T18:44:48+00:00

Does anybody know how to use the JsonRest store in dojo witn an Observable

  • 0

Does anybody know how to use the JsonRest store in dojo witn an Observable weapper, like the one in dojo.store.Observable?

What do I need, server side, to implement the store and make it work as an Observable one? What about the client side?
The documentation says http://dojotoolkit.org/reference-guide/1.7/dojo/store/Observable.html

If you are using a server side store like the JsonRest store, you will need to provide a queryEngine in order for the update objects to be properly included or excluded from queries. If a queryEngine is not available, observe listener will be called with an undefined index.

But, I have no idea what they mean. I have never created a store myself, and am not 100% familiar with queryEngine (to be honest, I find it a little confusing). Why is queryEngine needed? What does the doc mean by “undefined index”? And how do you write a queryEngine for a JsonRest store? Shouldn’t I use some kind of web socket for an observable REST store, since other users might change the data as well?

Confused!

  • 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-17T18:44:49+00:00Added an answer on June 17, 2026 at 6:44 pm

    I realize this quesiton is a bit old, but here’s some info for future reference. Since this is a multi-part question, I’ll break it down into separate pieces:

    1) Server-side Implementation of JsonRest

    There’s a pretty decent write up on implementing the server side of JsonRest Store. It shows exactly what headers JsonRest will generate and what content will be included in the rest. It helps form a mental model of how the JsonRest api is converted into HTTP.

    2) Query Engine

    Earlier in the same page, how query() works client side is explained. Basically, the query() function needs to be able to receive an object literal (ex: {title:'Learning Dojo',categoryid:5}) and return the objects in the store that match those conditions. "In the store" meaning already loaded into memory on the client, not on the server.

    Depending on what you’re trying to do, there’s probably no need to write your own queryEngine anyway — just use the built-in SimpleQueryEngine if you’re building your own custom store. The engine just needs to be handed an object literal and it adds the whole dojo query() api for you.

    3) Observables

    My understanding is that the Observables monitor client side changes in the collection of objects (ex: adding or removing a result) or even within a specific object (ex: post 5 has changed title). It does NOT monitor changes that happen server-side. It simply provides a mechanism to notify other aspects of the client-side app that data changed so that all aspects of the page stay synchronized.

    There’s a whole write up on using Observables under the headings ‘Collection Data Binding’ and ‘Object Data Binding: dojo/Stateful’.

    4) Concurrency

    There’s two things you’d want to do in order to keep your client side data synchronized with the server side data: a) polling for changes from other users on the server, b) using transactions to send data to the server.

    a) To poll for changes to the data, you’d want to have your object store track the active query in a variable. Then, use setTimeout() or setInterval() to run the query in the background again every so often. Make sure that widgets or other aspects of your application use Observables to monitor changes in the query result set(s) they depend on. That way, changes on the server by other users would automatically be reflected throughout your application.

    b) Use transactions to combine actions that must be combined. Then, make sure the server sends back HTTP 200 Status codes (meaning ‘It Worked!’). If the transactions returns a HTTP status in the 400s, then it didn’t work for some reason, and you need to requery the data because something changed on the backend. For example, the record you want to update was deleted, so you can’t update it. There’s a write up on transactions as well under the heading ‘Transactional’

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

Sidebar

Related Questions

Possible Duplicate: How can one use multi threading in php applications Does anybody know
Does anybody know of a way to use Guice to inject dependencies into the
Does anybody know a good place to learn how to use the debugger in
Does anybody know how to create a rails application that use noSql database? We
Does anybody use bare .SWF files as webpages? I know it's possible; it seems
does anybody know how to insert code into lyx? just like what is available
Does anybody know of any libraries that use design patterns that are implemented using
Does anybody know whether I can use multiple data sources in a single stateless
Does anybody know if it's possible to use Zend_Locale to get the ISO 3166-1
Does anybody know if it's possible to set up MSSQL 2008 to use Windows

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.