I work in extjs. I have a store like -
Ext.define('Balaee.store.qb.QbqnsStore',{
extend: 'Ext.data.Store',
model: 'Balaee.model.qb.QbqnsModel',
autoLoad: true,
proxy:
{
type:'ajax',
api:
{
read:index.php/QuestionBank/qbpaper/createpaper',
},
reader:
{type:'json',
//root:'polls',},
writer:
{type:'json',
root:'data',
}}});
Thus, the proxy read property is set above Url. Now I want to use the same store for some other view, but with a different read url. Also how to dynamically change the storage url? I tried, when I click the mouse I want to read data from url- /index.php/QuestionBank/qbpaper/Reviewquestionpaper111
So the button click function I wrote is
review:function()
{
var QbqnsStore=this.getStore('qb.QbqnsStore');
proxy=QbqnsStore.getProxy();
Ext.apply(proxy.api,{
read:'http://127.0.0.1/s_balaee/Balaee/index.php/QuestionBank/qbpaper/Reviewquestionpaper',
});
I create a variable for this store and provide the new required URL. Bt its not working. So, how to use the same store for different views with a different URL in the read property.
source
share