View Full Version : Load same store in a grid and in a combo

23 Apr 2013, 5:36 PM
I have to load a store that is already in use into a combo, but when i select a value in the combo the store reload in the grid with a filter with the value i clicked.

I have to create a store for the grid and a store to the combo or i can use the same store?
I don't want to the grid reloads.


xtype: 'combo',
name: 'cliente',
store: 'Clientes',
queryMode: 'local',
fieldLabel: 'Cliente',
valueField: 'clienteId',
displayField: 'nome',
allowBlank: false


Ext.define('Pagamator.store.Clientes', {
extend: 'Ext.data.Store',
model: 'Pagamator.model.Clientes',
autoLoad: true,

proxy: {
type: 'ajax',
api: {
read: 'data/clientesList.php',
update: 'data/clientesUpdate.php',
create: 'data/clientesCreate.php',
destroy: 'data/clientesDelete.php'
reader: {
type: 'json',
//root: 'data',
successProperty: 'success'
writer: {
type: 'json',
root: 'data',
encode: true


Ext.define('Pagamator.model.Clientes', {
extend: 'Ext.data.Model',
fields: [


25 Apr 2013, 10:38 AM
Sounds like you're not wanting to share a store instance between two components, but rather a store type shared between the components.

In your store definition you can give it an alias like alias: 'store.mystore'
and then in your components you can do:
store: { type: 'mystore' }

That way filtering grid store won't affect the combo store.