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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:19:08+00:00 2026-06-17T21:19:08+00:00

I created a model which contains a proxy to load a single record and

  • 0

I created a model which contains a proxy to load a single record and its takes no params. I don’t want to use a store since I’ll never have more then one record. I create an instance of the Model but can’t figure out how to tell it to call and load the record from the server. This is the only example I could find, but I don’t have an id to pass.

User.load(123, {
success: function(user) {
    console.log("Loaded user 123: " + user.get('name'));
}
});

Also I’m making and ajax call and not a rest call in case that matters.

  • 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-17T21:19:09+00:00Added an answer on June 17, 2026 at 9:19 pm

    The load(id, [config]) is static and will return provide you with a new record instance. It uses the proxy that was set via setProxy(proxy) (also static). Per default it will send a read request with the params id: 123. The static method allows you to set some default callbacks within the optional config object. These callbacks are needed to get the instance of the loaded record (or the error).

    How it works

    // create a Model class
    Ext.define('MyApp.User', {
        extend: 'Ext.data.Model',
        fields: [
            {name: 'id', type: 'int'},
            {name: 'name', type: 'string'}
        ]
    });
    
    // apply a proxy instance
    MyApp.User.setProxy(/*YourAjaxProxy*/);
    
    // prepare a handler
    var cb = function(model, op) {
        // log the new model instance
        console.log(model);
    };
    
    // get a instance
    MyApp.User.load(123, {
        scope: this, // should be the scope of the callback (cb)
        success: cb
    });
    

    Not what you need? Just comment…

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

Sidebar

Related Questions

I've created a class library which exposes my back-end object model. I don't wish
If model-first, we use [MetadataType(typeof(ConceptMetadataSource))] to attach a MetadataSource file which contains all the
I have a Product Model, which contains a foreign key to a ProductCategory record,
I am using CakePHP. I created an external class which is not a model
I want to create one new model class, which will be extended in all
I have got an Entity model which contains a collection of Message objects which
I have created a simple class which contains three properties ID Name Amount i
I have a model for categories, which contains a circular foreign key. I dumped
I have Event model which contains following fields string name date start_at date end_at
There is model call Event which contains following attributes start_at, end_at, details, trainer This

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.