I am studying the Ext JS framework and faced the following difficulty of sending a request through a proxy in the store file.For some reason, the request does not go away, but there is no error either. Also, Maybe somewhere in the code below I made a mistake. I don't particularly understand how to get data from the store from other components, that is, for example, I get data in the FormViewStore, and I need to get them, for example, in the NavView component, can I do it somehow, if so, please tell me how?
Below is the FormView file
Ext.define("ModernApp.view.form.FormView", {
extend: "Ext.form.Panel",
xtype: "formview",
title: "Custom Form",
store: { type: "formviewstore" },
controller: "formviewcontroller",
cls: "formView",
buttons: [
{
text: "Оправить",
handler: "onSubmit",
},
{
text: "Отмена",
handler: "onCancel",
},
],
listeners: {
afterrender: "onFormRender",
},
onFormRender() {
console.log("onFormRender");
var controller = this.getController();
// Загрузка данных из сторы
controller.loadFormViewStore();
},
items: [
{
xtype: "fieldset",
title: "About You",
instructions: "Tell us all about yourself",
items: [
{
xtype: "textfield",
name: "firstName",
label: "First Name",
listeners: {
change: {
fn: function (event) {
const name = Ext.ComponentQuery.query(
"textfield[name=firstName]"
)[0].getValue();
const surname = Ext.ComponentQuery.query(
"textfield[name=lastName]"
)[0].setValue(name || "");
},
},
},
},
{
xtype: "textfield",
name: "lastName",
label: "Last Name",
},
{
xtype: "datefield",
name: "birthday",
label: "Birthday",
},
{
xtype: "emailfield",
name: "email",
label: "Email",
},
{
xtype: "passwordfield",
name: "password",
label: "Password",
},
],
},
],
});
Below is the FormViewStore file
Ext.define("ModerdApp.view.form.FormViewStore", {
extend: "Ext.data.Store",
alias: "formviewstore",
proxy: {
type: "ajax",
url: "https://jsonplaceholder.typicode.com/posts",
reader: {
type: "myreader",
},
},
});
is the FormViewStore file
Ext.define("ModernApp.view.form.reader.Json", {
extend: "Ext.data.reader.Json",
alias: "myreader",
getResponseData: function (responce) {
console.log("response", responce);
},
});
I looked at the spread in the documentation, but I did not find a specific example of how to make a request through a proxy and get data in a customReader. Then I went to StackOverflow in the questions section but didn't find an answer to my question. Next I tried to change the proxy configuration but it didn't help either