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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T11:29:34+00:00 2026-05-21T11:29:34+00:00

I am using a JsonReader to map Json data to variables to be used

  • 0

I am using a JsonReader to map Json data to variables to be used in a grid/form. The back end is in Java and there are complex objects which I Jsonify and pass to the ExtJS front end.
This is a part of my JsonReader which tries to retrieve a nested object –

{name:'status', type: 'string', mapping: 'status.name'}

This works fine when status has a value (not null in the server), but the grid load fails when status is null. Currently the work around I have is to send an empty object from the server in case of null, but I assume there should be a way to handle this in ExtJS. Please suggest a better solution on the ExtJS side.

  • 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-21T11:29:35+00:00Added an answer on May 21, 2026 at 11:29 am

    I can think of two possibilities – one documented and one undocumented:

    1. use the convert()-mechanism of Ext.data.Field:

      {
          name:'status', 
          mapping: 'status',
          convert: function(status, data) {
              if (!Ext.isEmpty(status) && status.name) {
                  return status.name;
              } else {
                  return null;
              }
          }
      }
      
    2. The mapping property can also take an extractor function (this is undocumented so perhaps it may be a little bit risky to rely on this):

      {
          name:'status', 
          mapping: function(data) {
              if (data.status && data.status.name) {
                  return data.status.name;
              } else {
                  return null;
              }
          }
      }
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using EXT-JS 3.2.0 and I have an Ext.grid.EditorGridPanel backed by a Ext.data.Store
I am trying to populate a grid using a DirectStore. No data appears in
I am using following code: var genres1 = new Ext.data.Store({ reader: new Ext.data.JsonReader({ fields:
I'm trying to load data from the jsp response which is a JSON using
I am using jqGrid . I am loading the data into the grid from
I ran into a problem with jqGrid and JSON data. Basically the grid will
I am using a GroupingStore to load data into a grid, data is loaded
I'm using an Ext.data.JsonReader defined like so: new Ext.data.JsonReader ( { totalProperty: 'totalCount', successProperty:
I am using Ext.data.Store to call a PHP script which returns a JSON response
Using Microsoft SQL Server 2005, is there any way to see when a table

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.