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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:09:57+00:00 2026-06-01T18:09:57+00:00

i have defined my model with a REST proxy. it works fine for read

  • 0

i have defined my model with a REST proxy. it works fine for read (GET) and update (PUT) because those operations require a primary id. when i perform a create operation (POST) the proxy sends all the fields, including the empty primary id, to the server, which causes and error on the server. the server expects that no primary id is to be included for a create operation. how do i instruct extjs to not send the empty primary id value? ie. “{ ‘model_id’:”,…}”?

Ext.define('model', {
    extend : 'Ext.data.Model',
    idProperty : 'model_id',
    fields : ['model_id', 'first', 'last'],
    proxy : {
         type : 'rest'
    }
});

var mymodel = Ext.create('model',{last:'digler'});
mymodel.save() //posts "{ 'model_id':'', 'last':'digler'}"?

i want it to not include the primary id field at all on a create.

  • 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-01T18:09:59+00:00Added an answer on June 1, 2026 at 6:09 pm

    I think that this is a wrong way to change the structure of request. In the case of usage REST, the responsibility to operate create, update requests are fully on server side.

    In the case you still want to change parameters when create request is started, you can do it by “beforerequest” event:

    Ext.Ajax.on("beforerequest", function( conn, options, eOpts){
      if (options.action=='create')
      {
        var newData = 
               {'name': options.jsonData.name, 'email': options.jsonData.email }; 
        options.jsonData = newData;
      }
    });
    

    Just for example I re-defines data fields hard coded, but, of course, it’s possible to run through all fields in loop without writting its names in code.

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

Sidebar

Related Questions

I have a model defined this way class Lga < ActiveRecord::Base validates_uniqueness_of :code validates_presence_of
I have a model defined as below: class Example(models.Model): user = models.ForeignKey(User, null=True) other
I have defined a function in my Navigation model that executes a query, and
Let's say i have a Model defined as: Foo {Id, Date} . Is there
I have a base model that I extend from. In it, I have defined
So I have a self-joining model defined. Basically a post on a forum, and
I have several existing XML schema files with a defined data model. I would
All, i have the following model defined, class header(models.Model): title = models.CharField(max_length = 255)
I have an entity defined as in a db First Model: public class Merlin_BR_Condiciones_Item
I have this href defined in my markup: foreach (Car car in Model.Cars) {

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.