Why is the proxy different when I set it on the model, versus when I set it on the store?
i cannot do this:
So when I use this store, 1st one, in a row/cell editor, and I listen to the rowedit event, I need to add the proxy (THE SAME ONE), to the model as well. Not very DRY. The below code will fail without the extra added proxy on the model.
This could all be fixed by allowing one to load a model with custom parameters, like you can for a store.
Proxy changes if you set it on the store vs the model
Click on the button "View Proxy" to see the difference.
This should have the SAME URL. In old Ext JS 4, if you set a proxy on the model, the store using that model would inherit the proxy. Not anymore.
I need to set the proxy on the STORE when I want to load a store in a viewmodel with extraparams. (this is an annoyance btw), for example:
Code:
stores: {
addresses: {
type: 'Address',
autoLoad: true,
proxy:{
extraParams:{
CustomId:1
}
}
},
i cannot do this:
Code:
addressWithModelProxy: {
model:'AddresswProxy',// 'AddressWithModelProxy',
autoLoad: true,
proxy:{
extraParams:{
CustomId:1
}
}
}
So when I use this store, 1st one, in a row/cell editor, and I listen to the rowedit event, I need to add the proxy (THE SAME ONE), to the model as well. Not very DRY. The below code will fail without the extra added proxy on the model.
Code:
onRowEdit:function(editor,context){
context.record.save()
}
This could all be fixed by allowing one to load a model with custom parameters, like you can for a store.
Regardless if this is a "bug" or not, I would like a solution to not have to repeat the proxy and get the intended result, without any code duplication.
Thanks.
Proxy changes if you set it on the store vs the model
Aucun commentaire:
Enregistrer un commentaire