I have a Chart, which is in the Panel, Search gridPanel and Controller, which checks click on Search raw items. The controller that I use collects information on a click with the gridPanel raw and writes them into the parameters of the Proxy Stor (company code) and then call the external api. After clicking on the raw information is loaded, I checked the answer store.load (), the necessary data comes, but I can not load the chart and display the data on it. Here are the code footnotes: Controller:
this.control({ 'Search': { //gridPanel компонент, который мы проверяем selectionchange: this.SearchSelectionChange } }); }, SearchSelectionChange: function(arg, records) { if (records.length > 0) { var me = this; var record = records[0]; me.code = record.data.dataset_code; //getting code from raw me.store = Ext.create('Project.store.MarketDataStore'); //подгружаем store me.store.getProxy().extraParams = { code: me.code //меняем свойство Proxy нашего store. code берется с raw Search gridPanel'a }; me.store.load(function(records, success, options){ console.log(records); // выводит пришедшие данные(данные верны) if(records == null){Ext.Msg.alert('Error', 'Error');} }); var chart = Ext.create('Project.view.Chart'); //Теперь я так понимаю должен прогрузиться Chart? chart.redraw(); //И даже после этого чарт не прогружается } Panel: (Chart is automatically rendered when announcing)
Ext.define('Project.view.Panel', { extend: 'Ext.panel.Panel', requires: 'Project.view.Chart', alias: 'widget.ChartPanel', autoShow: true, layout: 'fit', items: [{ xtype: 'ProjectChart' }] }); and a piece of the Chart component: (series and axes are correct, tested on hardcoded data)
Ext.define('Project.view.Chart', { requires: ['Ext.chart.axis.Category','Ext.chart.axis.Numeric','Ext.chart.series.Line','Ext.util.Point', 'Project.store.MarketDataStore'], extend: 'Ext.chart.Chart', alias: 'widget.ProjectChart', store: 'MarketDataStore', storeId: 'сhart', renderTo: Ext.getBody(), animate: true, autoShow: true, I tried to store, model, Chart in one file and Chart was able to load after store.load () ;. Main question: How to properly load, reload, redraw Chart with correct Store data?
If the names of the classes do not dock somewhere, and so on - this is definitely not a problem, just corrected in your own interests and perhaps integrity has disappeared somewhere. The question is how to get Chart to accept data and then upload / overload to the screen Thank you.