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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T02:59:37+00:00 2026-06-02T02:59:37+00:00

I would like to know how to use the api attribute of a proxy

  • 0

I would like to know how to use the api attribute of a proxy in ST2

For now, I have this in my proxy configuration:

api: {
    create  : App.urls.create_object,
    read    : App.urls.load_object,
    update  : App.urls.update_object,
    destroy : App.urls.destroy_object
}

But then, I don’t know how to use it.
For instance, when I wanted to create a new object, I created an Ext.Ajax.request with these parameters :

url: App.urls.create_object,
params: {
    'object': object
},

But now, how could I do the same with the api attribute ?

Could you help ?

  • 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-02T02:59:38+00:00Added an answer on June 2, 2026 at 2:59 am

    Assuming you have a model like this:

    Ext.define('User', {
        fields: ['name', 'email'],
        proxy: {
            type: 'ajax',
            api: {
                create: 'my_create_url',
                read: 'my_read_url',
                update: 'my_update_url',
                destroy: 'my_destroy_url'
            }
        }
    });
    

    create

    var user = Ext.create('User', {name: 'Ed Spencer', email: 'ed@sencha.com'});
    
    user.save(); // will POST to the create url
    

    update

    var user = Ext.create('User', {name: 'Ed Spencer', email: 'ed@sencha.com'});
    user.save({
        success: function(user) {
            user.set('name', 'Robert Dougan');
    
            user.save(); // will PUT update URL
        }
    });
    

    read

    Using a store:

    var store = Ext.create('Ext.data.Store', {
        model: 'User'
    });
    
    store.load(); // will GET to read URL
    

    Using the model:

    // will GET the read URL with the specified ID.
    User.load(12, {
        success: function(user) {
            console.log(user);
        }
    });
    

    destroy

    var user = Ext.create('User', {name: 'Ed Spencer', email: 'ed@sencha.com'});
    user.save({
        success: function(user) {
            user.destroy(); // will DELETE destroy URL
        }
    });
    

    There is more information about this on the Rest proxy in the Sencha Docs: http://docs.sencha.com/touch/2-0/#!/api/Ext.data.proxy.Rest

    sync

    You can also use the store sync method to batch create/update/destroy all the records in your store.

    var store = Ext.create('Ext.data.Store', {
        model: 'User'
    });
    
    store.add({ name: 'Robert Dougan', email: 'rob@sencha.com' });
    
    store.sync(); // will batch update all the needed records
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to know what solution I can use in order to have
We use google-api-java-client to lookup videos and we would like to know if it
i would like to know how to use the java.util.logging api, in order to
I have access to an API that I would like to use, but it
I would like to know how to use Queue in the best functional way.
I would like to know if I can use the following JQuery function on
I would like to know how can I use tinyint in SQL Server 2005
I would like to know how can I use jQuery to select multiple items
I would like to know a few practical use-cases (if they are not related/tied
I would like to know if it is safe to use the following code

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.