PDA

View Full Version : Can't figure out why reference is not working.



robzdoom
19 Sep 2017, 11:08 AM
Version: 4.2.2.282
Channel: 4.2-stable
Platform: 1.6.2.49 - darwin x64
Renderer: 56.0.2924.87
Cmd: 6.5.1.240
Framework: Ext JS 6.5.x Classic

This is my code That i currently have as of now, I am trying to load up my store upon a button clicked by using reference.



Ext.define('TestAppClient.view.MyTabPanelViewController', {
extend: 'Ext.app.ViewController',
alias: 'controller.mytabpanel',

weekClick: function(button, e, eOpts) {
var op = this.lookupReference('testWeekButton');
this.getView('testWeekButton').store().load();
},

});


This is my grid panel. It is within a tab panel.



xtype: 'panel',
title: 'Operator Configuration',
items: [
xtype: 'gridpanel',
reference: 'testWeekButton',
itemId: 'opConfiguration',
scrollable: false,
store: 'FinancialCompareStore',
viewConfig: {
scrollable: false
},




When I try this i get this error
this.getView(...).store is not a function

I don't know what to do from here any help with be great appreciated.

alex.volfson
21 Sep 2017, 1:30 PM
it should be something like this: op.getStore().load().

getView() references the view the VC is attached to