I need to set an ajax request with a generated url.
Ext.define('Cc.store.Absences', {
extend: 'Ext.data.Store',
model: 'Cc.model.Absence',
autoLoad: false,
proxy: {
type: 'ajax',
url: 'person/user_id/absences', //I need a param to define user id
reader: {
type: 'json'
}
}
});
I think I have to use Ext.data.Operation but I don’t know how to do that.
If you are looking to dynamically generate an URL and assign it to the store, you can do it as follows:
To pass as normal parameters (POST or GET methods), you can use the technique explained by Warung Nasi.
You can use
Ext.data.Operationif you plan generate parameters automatically for sorting, filtering , grouping etc to your store’s proxy. You can read about the possible parameters in Ext.data.proxy.Ajax documentation. Refer the Url Generation sub heading.