Here is some code that creates a store on the fly based off some configuration values. I did not write the code, and it appears that when this code is executed, it automatically executes the ajax request to load the store:
How do I "see" the response of the ajax request? I've already changed my backend to send a specially formatted response that I want the front end to respond to. However, for the life of me, I cannot determine how to get to the ajax response. As you can see, I coded a load listener in an attempt to see when/how I can get the response (it will be a json formatted response) and do something based off that response (in this case, I will display an error message on the screen).
Code:
// Create the dynamic store var dynamicStore = Ext.create('Ext.data.Store', { fields: [modelFields], id: 'dynamicStore', sortOnLoad: true, //pageSize: 25, proxy: { type: 'ajax', extraParams: { pgm: this.selectedViewModelPgm, action: 'getViewData', inView: viewName }, url: '/valence/vvcall.pgm', reader: { type: 'json', rootProperty: 'datalist', totalProperty: 'totalCount' } }, autoLoad: true, listeners: { beforeload: { fn: me.onDynamicStoreBeforeLoad, scope: me }, load: { fn: function() { console.log('dynamic store load called. how do i see response?'); }, scope: me } } });
Comment