PDA

View Full Version : Store Code View Changes after looking at a Model



Artistan
20 Jan 2012, 1:21 PM
Load Project and look at a store.
Now I see the base store...

Ext.define('BenAdmin.store.base.Visit', {
extend: 'Ext.data.Store',
requires: [
'BenAdmin.model.Visit'
],

constructor: function(cfg) {
var me = this;
cfg = cfg || {};
me.callParent([Ext.apply({
autoLoad: true,
storeId: 'store_visit',
model: 'BenAdmin.model.Visit',
sortRoot: 'company',
remoteFilter: true,
remoteSort: true
}, cfg)]);
}
});

Then look at a Model...

Ext.define('BenAdmin.model.Visit', {
extend: 'Ext.data.Model',

remoteFilter: true,
remoteSort: true,

proxy: {
type: 'rest',
url: 'http://visits.benint.net/rest/siteshare/visits/',
reader: {
type: 'json',
idProperty: 'vid',
root: 'items',
totalProperty: 'totalCount'
}
},
fields: [
{
name: 'vid',
type: 'int'
},
{
name: 'vlid',
type: 'int'
},
{
name: 'vsid',
type: 'int'
},
{
name: 'compid',
type: 'int'
},
{
name: 'reporting_rep_id',
type: 'int'
},
{
dateFormat: '0000-00-00 00:00:00',
name: 'dtime',
type: 'date'
},
{
name: 'start'
},
{
name: 'end'
},
{
name: 'visit_notes',
type: 'string'
},
{
name: 'attendees',
type: 'string'
},
{
name: 'fedex_notes',
type: 'string'
},
{
name: 'pros_notes',
type: 'string'
},
{
name: 'cons_notes',
type: 'string'
},
{
name: 'chance_closing',
type: 'int'
},
{
name: 'listname'
},
{
name: 'sitename'
},
{
name: 'company'
},
{
mapping: 'displayname',
name: 'rep',
type: 'string'
},
{
name: 'site_abrv',
type: 'string'
}
]
});

Then look at the store again.
Now I only see the Visit, not the base store...

Ext.define('BenAdmin.store.Visit', {
extend: 'BenAdmin.store.base.Visit',
alias: 'widget.store_visit',

constructor: function(cfg) {
var me = this;
cfg = cfg || {};
me.callParent([Ext.apply({}, cfg)]);
}

});

Maybe show both????

aconran
10 Feb 2012, 4:44 PM
Artisan - Could you provide some more details here? Is this still an issue? Are you just saying you want to see both the base and implementation classes in the same view?

Artistan
10 Feb 2012, 6:31 PM
Artisan - Could you provide some more details here? Is this still an issue? Are you just saying you want to see both the base and implementation classes in the same view?

Showing both would be would be great. Much clearer with what is being generated by the code.
Mostly I wanted to state that it does change and that the change is very confusing.
I would prefer the base code over the implementation classes since they have the bulk of the configuration.
Thank You!