Kah0ona
3 Feb 2012, 8:03 AM
Hello,
I am using the following Store, in combination with the following Operation to fetch data from a proxy (fetch_proxy.php). The sorters and filters array should add parameters to the url of this proxy. Except it doesn't work, the default parameters are appended to the url, not my 'overriding' config, if I look at the resulting GET request.
Am I doing something wrong, or is this a bug?
In other words: how to add parameters to the url of a proxy?
Ext.define('myApp.store.Combined', {
extend: 'Ext.data.Store',
config : {
model: 'myApp.model.Shops',
proxy : {
type: 'ajax',
url: 'fetch_proxy.php',
reader: 'json'
}
},
});
Ext.define('myApp.store.ListOperation',{
extend: 'Ext.data.Operation',
config:{
model: 'myApp.model.Shops',
action: 'read',
sorters: [
new Ext.util.Sorter({
property: 'distance',
direction: 'ASC'
})
],
filters: [
new Ext.util.Filter({
property: 'lng',
value: 0
}),
new Ext.util.Filter({
property: 'lat',
value: 0
})
]
}
});
//load it, in app.js...
myApp.combinedStore = Ext.create('myApp.store.Combined');
myApp.listOperation = Ext.create('myApp.store.ListOperation');
myApp.combinedStore.load(myApp.listOperation);
This method did work in Sencha touch 1, but not in Touch 2.
Any ideas?
I am using the following Store, in combination with the following Operation to fetch data from a proxy (fetch_proxy.php). The sorters and filters array should add parameters to the url of this proxy. Except it doesn't work, the default parameters are appended to the url, not my 'overriding' config, if I look at the resulting GET request.
Am I doing something wrong, or is this a bug?
In other words: how to add parameters to the url of a proxy?
Ext.define('myApp.store.Combined', {
extend: 'Ext.data.Store',
config : {
model: 'myApp.model.Shops',
proxy : {
type: 'ajax',
url: 'fetch_proxy.php',
reader: 'json'
}
},
});
Ext.define('myApp.store.ListOperation',{
extend: 'Ext.data.Operation',
config:{
model: 'myApp.model.Shops',
action: 'read',
sorters: [
new Ext.util.Sorter({
property: 'distance',
direction: 'ASC'
})
],
filters: [
new Ext.util.Filter({
property: 'lng',
value: 0
}),
new Ext.util.Filter({
property: 'lat',
value: 0
})
]
}
});
//load it, in app.js...
myApp.combinedStore = Ext.create('myApp.store.Combined');
myApp.listOperation = Ext.create('myApp.store.ListOperation');
myApp.combinedStore.load(myApp.listOperation);
This method did work in Sencha touch 1, but not in Touch 2.
Any ideas?