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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T21:51:42+00:00 2026-06-18T21:51:42+00:00

Here is my model: Ext.define(‘Email’, { extend: ‘Ext.data.Model’, idProperty: ’emailid’, fields: [ { name:

  • 0

Here is my model:

Ext.define('Email', {
    extend: 'Ext.data.Model',
    idProperty: 'emailid',
    fields: [
        { name: 'emailid', type: 'int' },
        { name: 'emailsubject', type: 'string', useNull: true },
        { name: 'emailbody', type: 'string', useNull: true },
        { name: 'emailto', type: 'string', useNull: true },
        { name: 'emailfrom', type: 'string', useNull: true },
    ]
});

and DataStore:

var EmailDataStore = {

    getDetailStore: function(aid) {    

        var options =  {
            autoLoad: true,
            autoSync: true,
            pageSize: 1,
            remoteFilter: true,
            remoteGroup: true,
            remoteSort: true,
            model: 'Email',
            proxy: {
                type: 'ajax',
                url: 'datastores/datastore-email.asp?action=details&auditid=' + aid,
                reader: {
                    type: 'json',
                    root: 'emailDetails'
                }
            }
        };

        if (typeof (options2) != 'undefined') {
            options = Ext.merge(options, options2);
        }

        var detailStore = Ext.create('Ext.data.Store', options);
        return detailStore;
    }
}

I won’t include the ASP because the JSON is returning the data appropriately. But in this next bit of code,

...
PortalEmailGrid.prototype.detailStore = null;
PortalEmailGrid.prototype.showEmailDetails = function (id) {
    var self = this;
    //alert(id);
    self.detailStore = EmailDataStore.getDetailStore(id);
    //view store at this state - object appears to exist with the returned record in it
    console.log(self.detailStore);

    var firstItem = self.detailStore.first();
    //undefined here
    console.log(firstItem);
    //count is zero, but i can see the object in the console log above
    alert('detailStore count: ' + self.detailStore.count());

    var win = Ext.create('Ext.window.Window', {
        title: 'Email Details',
        store: self.detailStore,
        height: 400,
        width: 800,
        bodyPadding: 4,
        items: [
            {
                xtype: 'textfield',
                name: 'tofield',
                dataIndex: 'emailto',
                fieldLabel: 'To'
            },
                                {
                xtype: 'textfield',
                name: 'subjectfield',
                dataIndex: 'emailsubject',
                fieldLabel: 'Subject'
            }

        ]
    });

    win.show();
}

I cannot get the fields to populate with the detailStore‘s data. But when I log self.detailStore, in Firebug, I can see the object and its details. self.detailStore.count() shows zero, but according to the console, the data should be there. I suspect because of this discrepancy, the fields are not being populated with the dataIndex information. Also the previous code block was called by:

var selected = self.grid.selModel.selected;
var id = selected.items[0].raw.emailid;
//var status = selected.items[0].raw.status;
PortalEmailGrid.prototype.showEmailDetails(id);

Can you see any reason why the data isn’t loading from the datastore?

  • 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-18T21:51:43+00:00Added an answer on June 18, 2026 at 9:51 pm

    Store loading is asynchronous, by the time you’re logging the count to the console, the store is yet to be loaded. Firebug always shows the “up to date” status of the object, which is why you can see the data. You need to listen to the load event on the store.

    So if you remove the autoLoad config, you can do something like this:

    self.detailStore = EmailDataStore.getDetailStore(id);
    self.detailStore.load({
        callback: function(){
            console.log('loaded, do something');
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my model: Ext.define('A.model.Group', { extend: 'Ext.data.Model', fields:['id', 'name'], proxy: { type: 'rest',
Model Ext.define('XXX.User', { extend: 'Ext.data.Model', fields: [ 'name', 'email', 'nick', 'mobile', { name: 'create_time',
Below is the combo code: Ext.define('Grade', { extend: 'Ext.data.Model', fields: [ { name: 'id',
Here is a shortened version of my code : Ext.define('MyApp.model.Folder', { extend: 'Ext.data.Model', fields:
Ext.onReady(function() { Ext.define('User', { extend: 'Ext.data.Model', fields: [ 'name', 'class', 'view', 'edit', 'delete'] });
Ext.require([ 'Ext.grid.*', 'Ext.data.*', 'Ext.panel.*' ]); Ext.onReady(function(){ Ext.define('ImageModel', { extend: 'Ext.data.Model', fields: ['id', 'url', {name:'size',
I have definition of my model. Here is: Ext.define('KP.model.account.AccountList', { extend: 'Ext.data.Model', alias: 'model.d_AccountList',
Ext.define('ImageModel', { extend: 'Ext.data.Model', fields: ['PicID', 'PicUploadedDateTime','PicData'] }); var ImgStore = Ext.create('Ext.data.JsonStore', { model:
So I have a parent and child store, illustrated here: Parent Model Ext.define('APP.model.Client', {
Here's my model: public class StockRequestModel { public int StockID { get; set; }

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.