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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:58:08+00:00 2026-06-15T12:58:08+00:00

I am writing this great application. It’s my first attempt to write a one

  • 0

I am writing this great application. It’s my first attempt to write a one page fully AJAX application that only uses Restful stores on the other side.

Now… I wrote some of the code, and up to this point I have only needed simple queries with GET. However, in order to keep everything neat, I made sure that I had a “protocol” into place: each request had a response in the format:

{↵ "ack": "ERROR", "message": "required filter not passed",↵ "errors": { "name": "parameter required"↵ } }

In case there are errors (in this case, I require users to set a filter).

Now… if the GET does work, I also have a “data” field so that the result looks like this:

{↵ "ack": "OK", "data": { ... } }

Now I am having problems with Dojo, because for example dgrid expects data in the “root” (so to speak) of the returned object, rather than the “data” key.

Possible solutions:

1) Hack my JsonRest file (it’s already a little different, I added timeouts etc, it IS meant to be a boilerplate after all) so that, for “queries”, it actually manipulates results with a then() and returns raw data

2) Change my protocol, so that if the HTTP status is 200, and since there is no error message or anything to give out, it simply returns the data

3) Convince somehow all the widgets to use stuff in the “data” part of the returned JSON after a query (this seems highly unlikely).

Which way should I go? On one hand, I like the fact that the protocol follows the same format all the time (although I admit it’s useless). On the other hand, changing JsonRest seems easy enough. But then AGAIN, third party APIs might not like having to fish out data from the “data” key of the returned object…

What’s the sane thing to do here?

Thanks!

Merc.

  • 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-15T12:58:09+00:00Added an answer on June 15, 2026 at 12:58 pm

    I haven’t tried this but the docs indicate that if the JsonRest query generates an HTTP error code, the xhr error object will get passed all the way up to the dgrid and is one of the data associated with the dgrid-error event.

    dgrid core components
    dgrid issue mentioning query errors

    If that works correctly then I would go with solution 2 because it requires the least modifications to standard components and uses only the API provided.

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

Sidebar

Related Questions

This is a generic C++ design question. I'm writing an application that uses a
I am writing an application which tests email addresses, for one part of this
I am writing a small application for reminders. For this, I got great help
In the application that I am writing I am trying to write a list
I'm writing an asp.net Web Application. I wrote a login page that authenticates a
I'm writing a Qt application that uses a QWebView to host the UI. Similar
I'm writing multicast client/server application based on this and this ; which work great.
I've had trouble writing this code. I'm supposed to make a function that can
I am writing an application that gets its dimensions from the paper ratio of
I'm writing an application that needs to read a list of strings from a

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.