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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T20:30:32+00:00 2026-05-20T20:30:32+00:00

I have a JsonStore configured like so: var store = new Ext.data.JsonStore({ restful: true,

  • 0

I have a JsonStore configured like so:

var store = new Ext.data.JsonStore({
    restful: true,
    url: '/categories',
    remoteSort: true,
    idProperty: 'Id',
    totalProperty: 'total',
    root: 'results',
    writer: new Ext.data.JsonWriter({
        encode: false
    }),

    fields: [ 'Id', 'Name' ]
});

I grab some data from the server, then edit one of the records. When I tell the store to save, it sends this JSON back to the server:

{
    "results":
    {
        "Name":"Trivial123",
        "Id":2
    }
}

The store is wrapping the JSON inside the results property (the root property configured on the store). However, the server expects this:

{
    "Name":"Trivial123",
    "Id":2
}

In other words, the serialized entity should be put directly in the response body, and not wrapped in a property. Does anyone know how I can configure the store to do this?

  • 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-20T20:30:32+00:00Added an answer on May 20, 2026 at 8:30 pm

    You need to override the data rendering function in the JsonWriter, like so:

    var rootlessRenderFunction = function (params, baseParams, data) {
       if (this.encode === true) {
          Ext.apply(params, baseParams);
          params = Ext.encode(data);
       } else {
          params.jsonData = data;
       }
    };
    
    var myWriter = new Ext.data.JsonWriter({
       encode: false,
       writeAllFields: true
    });
    myWriter.render = rootlessRenderFunction;
    
    var myStore = new Ext.data.JsonStore({
       // ... various config values ...
       writer: myWriter
    });
    

    This “rootlessRenderFunction” implementation is the same as the Ext JsonWriter’s render code except it doesn’t interpose a root in the request data.

    This is a hack, of course.

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

Sidebar

Related Questions

I have a JsonStore: var store = new Ext.data.JsonStore({ root: 'Data.items', remoteSort: false, fields:
I have a store which is defined something like this: var AdditionalGridData = new
Iam design ExtJs Combo and bind from database var AddEditPeopleStoreCompanyLocation = new Ext.data.JsonStore ({
I have an ExtJS combobox with a remote data store behind it. In all
I have found this example on StackOverflow: var people = new List<Person> { new
I have a jsonstore that is supposed to load a user's information. I have
I have a JsonStore that needs to return from an HTTP request that takes
I have problems getting data from grails using extjs. My Grails controller code is:
Have I correctly added an element to a hashTable? Flows flows = new Flows(sIP,dIP);
Have you seen library for flexible working with terminal(Unix like)? I want to implement

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.