Hybrid View
-
8 Dec 2012 2:27 AM #1
Answered: Different stores with different (so I thought) proxies WTF !?
Answered: Different stores with different (so I thought) proxies WTF !?
Hey guys ..
Need a little explanation about proxies ...
I've got a form with components that call same URL through it's storage proxies.
The problem is with extra params ...
In some cases I have to set extra parameters to a proxy .. and ALL proxies now have that same parameters !!!
copy paste from debug window:
Code:proxy from store 1: constructor {type: "ajax", url: "http://fukec:8080/kliping-admin/rest/extEntities/searchEntities", extraParams: Object, reader: constructor, hasListeners: HasListeners…} api: Object events: Object extraParams: Object language: "en" type: "5a0d42a3-da66-3452-a44a-e9b36100a44a" __proto__: Object hasListeners: HasListeners model: function constructor() { nocache: true reader: constructor type: "ajax" url: "http://fukec:8080/kliping-admin/rest/extEntities/searchEntities" writer: constructor __proto__: TemplateClass proxy from store 2: constructor {type: "ajax", url: "http://fukec:8080/kliping-admin/rest/extEntities/searchEntities", extraParams: Object, reader: constructor, hasListeners: HasListeners…} api: Object events: Object extraParams: Object language: "en" type: "5a0d42a3-da66-3452-a44a-e9b36100a44a" __proto__: Object hasListeners: HasListeners model: function constructor() { nocache: true reader: constructor type: "ajax" url: "http://fukec:8080/kliping-admin/rest/extEntities/searchEntities" writer: constructor __proto__: TemplateClass
check the type extra parameter .. it's in both proxies ... and I only set it once on second proxy!
Any explanation and/or fix would be appreciated!
Regards
Armando
-
Best Answer Posted by armandoxxx
Hey
Yes I use two different stores..
Ext.create('store1', {storeId:'store1'});
Ext.create('store2', {storeId:'store2'});
is the code .. and console throws 2 different stores out ..
but I found out what was the problem ...
old code:
new code :PHP Code:Ext.require('model.NamedEntity');
Ext.define('store.NamedEntity', {
extend : 'Ext.data.Store',
model : 'model.NamedEntity',
autoLoad : false,
pageSize : 50,
proxy : {
type : 'ajax',
url : FORM_SEARCH_ENTITIES_PATH,
extraParams : {
language : Dict.getDefaultLanguage()
},
reader : {
type : 'json',
root : 'data',
totalProperty : 'total'
}
}
});
they shared properties on create !!!PHP Code:Ext.require('model.NamedEntity');
Ext.define('store.NamedEntity', {
extend : 'Ext.data.Store',
constructor : function(theConfig) {
Ext.apply(this, {
model : 'model.NamedEntity',
autoLoad : false,
pageSize : 50,
proxy : {
type : 'ajax',
url : FORM_SEARCH_ENTITIES_PATH,
extraParams : {
language : Dict.getDefaultLanguage()
},
reader : {
type : 'json',
root : 'data',
totalProperty : 'total'
}
}
});
this.initConfig(theConfig);
this.callParent(arguments);
}
});
Regards
Armando
-
8 Dec 2012 3:10 AM #2
It seems, that your proxies don't share the same parameters... your stores share the same proxies xD
Do you really use 2 different stores?
-
8 Dec 2012 3:19 AM #3
[SOLVED]
[SOLVED]
Hey
Yes I use two different stores..
Ext.create('store1', {storeId:'store1'});
Ext.create('store2', {storeId:'store2'});
is the code .. and console throws 2 different stores out ..
but I found out what was the problem ...
old code:
new code :PHP Code:Ext.require('model.NamedEntity');
Ext.define('store.NamedEntity', {
extend : 'Ext.data.Store',
model : 'model.NamedEntity',
autoLoad : false,
pageSize : 50,
proxy : {
type : 'ajax',
url : FORM_SEARCH_ENTITIES_PATH,
extraParams : {
language : Dict.getDefaultLanguage()
},
reader : {
type : 'json',
root : 'data',
totalProperty : 'total'
}
}
});
they shared properties on create !!!PHP Code:Ext.require('model.NamedEntity');
Ext.define('store.NamedEntity', {
extend : 'Ext.data.Store',
constructor : function(theConfig) {
Ext.apply(this, {
model : 'model.NamedEntity',
autoLoad : false,
pageSize : 50,
proxy : {
type : 'ajax',
url : FORM_SEARCH_ENTITIES_PATH,
extraParams : {
language : Dict.getDefaultLanguage()
},
reader : {
type : 'json',
root : 'data',
totalProperty : 'total'
}
}
});
this.initConfig(theConfig);
this.callParent(arguments);
}
});
Regards
Armando


Reply With Quote