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????
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????