View Full Version : difference of using proxy

13 Sep 2012, 4:10 AM
can any one tell me the difference between using proxy to the model or the store. I always place proxy type in the store not on the model..but when i tried to update a record from a grid using this

updateUser: function(button) {
var win = button.up('window');
form = win.down('form');
record = form.getRecord();
values = form.getValues();
params: { },
record.commit();on my controler...i get

Ext.Error: You are using a ServerProxy but have not supplied it with a url. error.when the proxy is placed in store...but works fine when i place the proxy in the model defnition. here is my proxy defnition.
proxy: {

type: 'ajax',
api: {
read: 'app/data/php/searchData.php',
update: 'app/data/php/updateData.php'

reader: {
type: 'json',
root: 'results',
totalProperty: 'total',
successProperty: 'success'

writer: {
type: 'json',
writeAllFields: true,
allowSingle: false,
root: 'data'

actionMethods:'POST' //
...... so what is happening?????

17 Sep 2012, 9:07 AM
Either is ok. If you want to be able to load a Model instance by itself, not via a store, then you of course must put it on the Model.