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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:17:47+00:00 2026-05-31T07:17:47+00:00

The JSONP proxy is largely working for me, but I need to set properties

  • 0

The JSONP proxy is largely working for me, but I need to set properties of a model based on some nested properties in the JSON response. I can’t figure how to do this without extending the Reader class, but thought there might be an easier way that I’m just missing.

My Recipe model:

Ext.define('NC.model.Recipe', {
  extend: 'Ext.data.Model',
  config: {
    fields: [
      { name: 'name', type: 'string' },
      { name: 'image', type: 'string' },
      { name: 'preparationText', type: 'string' },
      { name: 'ingredientsText', type: 'string' },
      { name: 'servings', type: 'string' }
    ]
  }
});

My Store:

Ext.define('NC.store.Recipes', {
  extend: 'Ext.data.Store',

  config: {
    model: 'NC.model.Recipe',
    storeId: 'Recipes',
    proxy: {
      type: 'jsonp',
      url: 'http://anExternalSite.com/api',
      callbackKey: 'callback',
      filterParam: 'text',
      extraParams: {
        type: 'Recipe'
      },
      reader: {
        type: 'json',
        idProperty: 'uuid',
      }
    }
  }
});

The JSON format:

[
  {
    uuid: "/UUID(XXXX)/",
    name: "Spicy Peanut Noodle Salad",
    image: "http://someplace.com/noodle-salad.jpg",
    properties: {
      preparationText: "Make it all nice and stuff",
      ingredientsText: "Heaps of fresh food",
      servings: "serves 4",
    }
  },
  { ... },
  { ... }
]

I would like those 3 ‘properties’ – preparationText, ingredientsText, and servings, to be placed in the model, but currently only id, name, and image are. What is the method to make this work? If it does involve extending the Reader class, some direction would be great.

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-05-31T07:17:48+00:00Added an answer on May 31, 2026 at 7:17 am

    You can change your code like this to access nested values

    { name: 'preparationText', type: 'string', mapping: 'properties.preparationText' },
    

    This mapping path should start excluding the root element.

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

Sidebar

Related Questions

Based on Please explain JSONP , I understand that JSONP can be used to
I have a WCF API which supports SOAP/JSON/XML but we don't provide JSONP. This
Ok I am trying to access some JSON using a PHP proxy as I
I have this bit of javascript: var jsonString = some string of json; $.post('proxy.php',
If there anyway allows AJAX between two own domains without proxy hacking, JSONP, Flash
I've encountered a problem when retrieving a JSONP response from a server in a
JSON stands for JavaScript Object Notation. But how come languages like php, java, c
From my understanding JSONP can only be achieved using the GET verb. Assuming this
Using sencha touch 2, am trying to render a nestedlist with json proxy. The
Can some one tell me how to pass data from controller to a data

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.