wallynm
17 Jan 2012, 10:26 PM
Hello guys, i'm needing to use Ext.create at one store defined on the system...
The problem it's because when i try to do it, firefox and crhome return errors:
Crhome:
c is not a constructor
...instantiators[length] = new Function('c', 'a', 'return new c('+args.join(',')+'...
Firefox:
Uncaught TypeError: object is not a function
Well, i have any idea why it is happening...
Here it's defined codes, creation and etc...
Ext.define('gconnect.view.Financeiro.Lancamento.Sidebar', { extend: 'Ext.grid.Panel',
id:'SidebarLancamento',
alias: 'widget.SidebarLancamento',
store: Ext.create('gconnect.store.Financeiro.ListaContas.ListaContas'),
layout:'fit',
border:false,
features: [
Ext.create('Ext.grid.feature.Grouping', {
groupHeaderTpl: '{name} ({rows.length})',
startCollapsed: true
})
],
columns:[
{header: 'Conta', dataIndex: 'nome', flex: 1},
{header: 'Saldo Atual', dataIndex: 'saldoatual', flex: 1}
]
});
My problem it's with this line:
Ext.create('gconnect.store.Financeiro.ListaContas.ListaContas')
My store definition:
Ext.define('gconnect.store.Financeiro.ListaContas.ListaContas', { extend: 'Ext.helper.Abstract.DefaultStore',
model: 'gconnect.model.Financeiro.ListaContas.ListaContas',
idProperty: 'codlistaconta',
urlRead: baseurl+'financeiro/lista_contas/listar',
urlSave: baseurl+'financeiro/lista_contas/salvar',
urlDelete: baseurl+'financeiro/lista_contas/deletar'
});
My Extended store:
Ext.define('Ext.helper.Abstract.DefaultStore', {
extend: 'Ext.data.Store',
//autoLoad: true,
autoSync: true,
pageSize: 20,
idProperty: undefined,
urlRead: undefined,
urlSave: undefined,
urlDelete: undefined,
constructor: function(options){
Ext.apply(this,options || {});
this.proxy = {
method: 'POST',
type: 'ajax',
url: this.urlRead,
actionMethods: { read: 'POST' },
reader: {
idProperty: this.idProperty,
type: 'json',
root: 'data',
totalProperty: 'total',
successProperty: 'success'
}
}
this.callParent(arguments);
}
})
The problem it's because when i try to do it, firefox and crhome return errors:
Crhome:
c is not a constructor
...instantiators[length] = new Function('c', 'a', 'return new c('+args.join(',')+'...
Firefox:
Uncaught TypeError: object is not a function
Well, i have any idea why it is happening...
Here it's defined codes, creation and etc...
Ext.define('gconnect.view.Financeiro.Lancamento.Sidebar', { extend: 'Ext.grid.Panel',
id:'SidebarLancamento',
alias: 'widget.SidebarLancamento',
store: Ext.create('gconnect.store.Financeiro.ListaContas.ListaContas'),
layout:'fit',
border:false,
features: [
Ext.create('Ext.grid.feature.Grouping', {
groupHeaderTpl: '{name} ({rows.length})',
startCollapsed: true
})
],
columns:[
{header: 'Conta', dataIndex: 'nome', flex: 1},
{header: 'Saldo Atual', dataIndex: 'saldoatual', flex: 1}
]
});
My problem it's with this line:
Ext.create('gconnect.store.Financeiro.ListaContas.ListaContas')
My store definition:
Ext.define('gconnect.store.Financeiro.ListaContas.ListaContas', { extend: 'Ext.helper.Abstract.DefaultStore',
model: 'gconnect.model.Financeiro.ListaContas.ListaContas',
idProperty: 'codlistaconta',
urlRead: baseurl+'financeiro/lista_contas/listar',
urlSave: baseurl+'financeiro/lista_contas/salvar',
urlDelete: baseurl+'financeiro/lista_contas/deletar'
});
My Extended store:
Ext.define('Ext.helper.Abstract.DefaultStore', {
extend: 'Ext.data.Store',
//autoLoad: true,
autoSync: true,
pageSize: 20,
idProperty: undefined,
urlRead: undefined,
urlSave: undefined,
urlDelete: undefined,
constructor: function(options){
Ext.apply(this,options || {});
this.proxy = {
method: 'POST',
type: 'ajax',
url: this.urlRead,
actionMethods: { read: 'POST' },
reader: {
idProperty: this.idProperty,
type: 'json',
root: 'data',
totalProperty: 'total',
successProperty: 'success'
}
}
this.callParent(arguments);
}
})